Objetivo: Construir un modelo lineal que nos permita comprender cuales fueron los factores determinantes en las muertes que se produjeron por el Covid-19, que tuvo una amplia variabilidad en diferentes países.
El modelo se basa en una serie da variables demográficas, geográficas y de salud publica obtenidad de 139 países:
Hombres80 población de hombres mayor a 80 años (% de
la población masculina).
Mujeres80 población de mujeres mayor a 80 (% de la
población femenina).
Pobla80: promedio entre Female80 y
Male80.
Pobla65: población mayor a 65 años (% de la
población).
PoblaMid: población entre 15 y 64 años (% de la
población).
PoblaData: población en 2018 (en 100 millones de
personas).
PoblaDens: densidad poblacional (cientos de personas
por km cuadrado de superficie)
Mujeres: Población femenina (% de la población
total)
Urbano: Población urbana (% de la población
total)
ExpectVida: Esperanza de vida al nacer, total
(años)
NeontlMort: Tasa de mortalidad neonatal, neonatal
(por 1000 nacidos vivos)
DisMort: Mortalidad por enfermedades
cardiovasculares, cáncer, diabetes o enfermedad renal crónica entre las
edades exactas de 30 y 70 (%)
Lesion: Causa de muerte por lesión (% del
total)
EnfNoTrans: Causa de muerte por enfermedades no
transmisibles (% del total)
EnfTrans: Causa de muerte por por enfermedades
transmisibles y materna, prenatal y condiciones nutricionales (% del
total)
PBI: producto bruto interno per cápita PPP (miles de
dolares internacionales corrientes)
Tuberculosis: Incidencia de tuberculosis (por 1000
personas)
Diabetes: Prevalencia de la diabetes ( % de la
población de 20 a 79 años)
Medicos: Médicos (cada 1000 personas)
Camas: Camas de hospital (cada 1000
personas)
ImmunSaramp: Inmunización de sarampión (% de chicos
entre 12 y 23 meses)
TempMarzo: Temperatura promedio en marzo.
HipTen.H: Prevalencia bruta de hipertensión en 2010
en hombres
HipTen.M: Prevalencia bruta de hipertensión en 2010
en mujeres
HipTen: Promedio de HT.women y HT.men
BCG: Estrategia de inmunización
0 = selectiva, 1 = todos.
BCGf: Es la variables BCG escrita como un
factor.
Tiempo: número de días entre el primer caso de
COVID-19 registrado y el 31 de diciembre de 2019.
geoid: ID para identificar la zona
CntrName : País
Variable de respuesta:
l10muertes.permil: log10(muertes.permil+1) donde
muertes.permil es el número de muertos cada millón de habitantes.
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(GGally)
## Loading required package: ggplot2
## Registered S3 method overwritten by 'GGally':
## method from
## +.gg ggplot2
library(ggplot2)
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✔ tibble 3.1.7 ✔ purrr 0.3.4
## ✔ tidyr 1.2.0 ✔ stringr 1.4.0
## ✔ readr 2.1.2 ✔ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
library(hrbrthemes)
## NOTE: Either Arial Narrow or Roboto Condensed fonts are required to use these themes.
## Please use hrbrthemes::import_roboto_condensed() to install Roboto Condensed and
## if Arial Narrow is not on your system, please see https://bit.ly/arialnarrow
library(ggpubr)
library(cowplot)
##
## Attaching package: 'cowplot'
## The following object is masked from 'package:ggpubr':
##
## get_legend
library(caTools)
library(corrplot)
## corrplot 0.92 loaded
library(Hmisc)
## Loading required package: lattice
## Loading required package: survival
## Loading required package: Formula
##
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:dplyr':
##
## src, summarize
## The following objects are masked from 'package:base':
##
## format.pval, units
library(multcomp)
## Loading required package: mvtnorm
## Loading required package: TH.data
## Loading required package: MASS
##
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
##
## select
##
## Attaching package: 'TH.data'
## The following object is masked from 'package:MASS':
##
## geyser
library(readxl)
library(gmodels)
library(ggthemes)
##
## Attaching package: 'ggthemes'
## The following object is masked from 'package:cowplot':
##
## theme_map
library(devtools)
## Loading required package: usethis
library(car)
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:purrr':
##
## some
## The following object is masked from 'package:dplyr':
##
## recode
library(leaflet)
library(psych)
##
## Attaching package: 'psych'
## The following object is masked from 'package:car':
##
## logit
## The following object is masked from 'package:Hmisc':
##
## describe
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
covid <- read.table('COVID.txt', header = TRUE)
covid
## geoId CntrName muertes casos muertes.permil
## AF AF Afghanistan 227 12456 6.10668360
## AL AL Albania 33 1050 11.51279525
## DZ DZ Algeria 623 8857 14.75309441
## AO AO Angola 4 71 0.12982898
## AR AR Argentina 500 13920 11.23734344
## AM AM Armenia 98 7774 33.20035125
## AU AU Australia 103 7139 4.12125797
## AT AT Austria 645 16515 72.90576495
## AZ AZ Azerbaijan 54 4568 5.43132025
## BD BD Bangladesh 544 38292 3.37142634
## BY BY Belarus 214 38956 22.56102177
## BE BE Belgium 9364 57592 819.81651659
## BZ BZ Belize 2 18 5.22096426
## BJ BJ Benin 3 210 0.26120918
## BT BT Bhutan 0 28 0.00000000
## BO BO Bolivia 280 7768 24.66277617
## BA BA Bosnia_and_Herzegovina 151 2435 45.42816649
## BW BW Botswana 1 35 0.44363092
## BR BR Brazil 25598 411821 122.20404597
## BN BN Brunei_Darussalam 2 141 4.66241765
## BG BG Bulgaria 133 2460 18.93449746
## BF BF Burkina_Faso 53 845 2.68333575
## BI BI Burundi 1 42 0.08948243
## KH KH Cambodia 0 124 0.00000000
## CM CM Cameroon 177 5436 7.01928682
## CA CA Canada 6765 87508 182.54745910
## CF CF Central_African_Republic 1 702 0.21429902
## CO CO Colombia 803 24104 16.17364085
## KM KM Comoros 2 87 2.40291618
## CG CG Congo 19 571 3.62293762
## HR HR Croatia 101 2244 24.69799971
## CZ CZ Czech_Republic 317 9086 29.83334267
## DK DK Denmark 565 11480 97.45670766
## DJ DJ Djibouti 18 2697 18.77111751
## DO DO Dominican_Republic 474 15723 44.60267625
## EC EC Ecuador 3275 38103 191.69583028
## EG EG Egypt 816 19666 8.29069493
## SV SV El_Salvador 39 2109 6.07406245
## GQ GQ Equatorial_Guinea 12 1043 9.16748537
## EE EE Estonia 66 1840 49.96653756
## ET ET Ethiopia 6 731 0.05493270
## FJ FJ Fiji 0 18 0.00000000
## FI FI Finland 313 6692 56.72293654
## FR FR France 28596 145746 426.88724438
## GA GA Gabon 14 2319 6.60603272
## GM GM Gambia 1 25 0.43857687
## GE GE Georgia 12 735 3.21629590
## DE DE Germany 8411 179717 101.42542822
## GH GH Ghana 34 7303 1.14220031
## EL EL Greece 173 2903 16.12652442
## GT GT Guatemala 68 4145 3.94253020
## GN GN Guinea 21 3446 1.69159514
## GY GY Guyana 11 139 14.12059502
## HT HT Haiti 34 1320 3.05668093
## HN HN Honduras 194 4640 20.23463414
## HU HU Hungary 509 3816 52.10473974
## TD TD Chad 64 715 4.13496767
## CL CL Chile 841 82289 44.90324179
## CN CN China 4638 84106 3.33015014
## IN IN India 4531 158333 3.34980183
## ID ID Indonesia 1473 23851 5.50317977
## IR IR Iran 7564 141591 92.46913357
## IQ IQ Iraq 175 5135 4.55330752
## IE IE Ireland 1631 24803 336.04573683
## IL IL Israel 281 16793 31.63060852
## IT IT Italy 33072 231139 547.26622303
## JM JM Jamaica 9 569 3.06659102
## JP JP Japan 858 16651 6.78104879
## JO JO Jordan 9 720 0.90397650
## KZ KZ Kazakhstan 37 9576 2.02445775
## KE KE Kenya 55 1471 1.07018445
## KW KW Kuwait 175 23267 42.29802512
## LV LV Latvia 23 1057 11.93848875
## LB LB Lebanon 26 1161 3.79621619
## LS LS Lesotho 0 2 0.00000000
## LR LR Liberia 27 266 5.60284890
## LY LY Libya 4 99 0.59893088
## LT LT Lithuania 66 1647 23.65987425
## LU LU Luxembourg 110 4001 181.00202722
## MG MG Madagascar 2 612 0.07615460
## MW MW Malawi 4 101 0.22046688
## MY MY Malaysia 115 7619 3.64748370
## ML ML Mali 70 1116 3.66920733
## MR MR Mauritania 16 292 3.63362273
## MU MU Mauritius 10 334 7.90324531
## MX MX Mexico 8597 78023 68.12700147
## MD MD Moldova 274 7537 77.27271317
## MN MN Mongolia 0 161 0.00000000
## ME ME Montenegro 9 324 14.46143216
## MA MA Morocco 202 7601 5.60657321
## MZ MZ Mozambique 1 227 0.03390295
## MM MM Myanmar 6 206 0.11171438
## NM NM Namibia 0 22 0.00000000
## NP NP Nepal 4 886 0.14241022
## NL NL Netherlands 5871 45768 340.72277916
## NZ NZ New_Zealand 22 1154 4.50312148
## NI NI Nicaragua 35 759 5.41333688
## NE NE Niger 64 955 2.85167528
## NO NO Norway 235 8383 44.22001168
## OM OM Oman 38 8373 7.86833705
## PK PK Pakistan 1260 61227 5.93737399
## PA PA Panama 315 11728 75.41526879
## PY PY Paraguay 11 884 1.58135246
## PE PE Peru 3983 135905 124.51055442
## PH PH Philippines 904 15049 8.47617167
## PL PL Poland 1028 22473 27.06791213
## PT PT Portugal 1356 31292 131.88400976
## QA QA Qatar 30 48947 10.78486107
## RO RO Romania 1219 18594 62.59648794
## RW RW Rwanda 0 346 0.00000000
## VC VC Saint_Vincent_and_the_Grenadines 0 18 0.00000000
## SA SA Saudi_Arabia 425 78541 12.61129580
## SN SN Senegal 39 3253 2.45989116
## RS RS Serbia 240 11275 34.37369129
## SL SL Sierra_Leone 45 782 5.88223453
## SG SG Singapore 23 32876 4.07897173
## SK SK Slovakia 28 1515 5.14043390
## SI SI Slovenia 107 1471 51.75652955
## ZA ZA South_Africa 552 25937 9.55354121
## KR KR South_Korea 269 11344 5.20961879
## ES ES Spain 27118 236769 580.39007101
## LK LK Sri_Lanka 10 1469 0.46146747
## SE SE Sweden 4220 35088 414.40906201
## CH CH Switzerland 1647 30678 193.38832670
## TJ TJ Tajikistan 46 3100 5.05448015
## TH TH Thailand 57 3054 0.82098822
## TG TG Togo 13 395 1.64784448
## TN TN Tunisia 48 1051 4.15038075
## TR TR Turkey 4397 158762 53.41368734
## UG UG Uganda 0 281 0.00000000
## UA UA Ukraine 644 21584 14.43217590
## AE AE United_Arab_Emirates 255 31969 26.47711407
## UK UK United_Kingdom 37460 267240 563.40154117
## US US United_States_of_America 100442 1699933 307.00488362
## UY UY Uruguay 22 803 6.37810755
## UZ UZ Uzbekistan 14 3333 0.42481657
## YE YE Yemen 53 255 1.85973480
## ZM ZM Zambia 7 1057 0.40341585
## ZW ZW Zimbabwe 4 132 0.27702715
## casos.permil l10muertes.permil Hombres80 Mujeres80 Pobla80 Pobla65
## AF 3.350874e+02 0.85166698 0.23332582 0.3209823 0.2771541 2.584927
## AL 3.663162e+02 1.09735434 2.44807869 3.0339539 2.7410163 13.744736
## DZ 2.097402e+02 1.19736588 1.18175550 1.3602137 1.2709846 6.362497
## AO 2.304464e+00 0.05301271 0.20753263 0.3372488 0.2723907 2.216374
## AR 3.128476e+02 1.08768715 1.77481880 3.4475320 2.6111754 11.117789
## AM 2.633669e+03 1.53403057 2.45959960 3.7882699 3.1239347 11.253818
## AU 2.856472e+02 0.70937665 3.40801882 4.6792491 4.0436339 15.656475
## AT 1.866727e+03 1.86867832 3.92008681 6.5538665 5.2369767 19.001566
## AZ 4.594495e+02 0.80830014 0.98233980 1.7371450 1.3597424 6.195183
## BD 2.373137e+02 0.64062316 0.92567665 1.0671409 0.9964088 5.158391
## BY 4.106949e+03 1.37219412 1.98505780 5.6239517 3.8045048 14.845148
## BE 5.042169e+03 2.91424609 4.26847412 7.1212019 5.6948380 18.788744
## BZ 4.698868e+01 0.79385771 1.04770490 1.0313461 1.0395255 4.736459
## BJ 1.828464e+01 0.10078712 0.33308679 0.5400435 0.4365651 3.253605
## BT 3.711588e+01 0.00000000 1.20832395 1.2107077 1.2095158 6.003012
## BO 6.842159e+02 1.40930364 1.36894924 1.8807749 1.6248620 7.191947
## BA 7.325668e+02 1.66678153 2.62930836 4.1430706 3.3861895 16.470317
## BW 1.552708e+01 0.15945618 0.32968114 0.6582073 0.4939442 4.223874
## BR 1.966020e+03 2.09062497 1.38043099 2.2316251 1.8060280 8.922838
## BN 3.287004e+02 0.75300190 0.68594552 0.8308421 0.7583938 4.873148
## BG 3.502170e+02 1.29960529 3.47833930 5.9662322 4.7222857 21.021914
## BF 4.278149e+01 0.56624131 0.17806863 0.3125849 0.2453268 2.406981
## BI 3.758262e+00 0.03722023 0.22728873 0.3563006 0.2917947 2.246940
## KH 7.630864e+00 0.00000000 0.44915480 0.6916225 0.5703887 4.568680
## CM 2.155754e+02 0.90413575 0.24541433 0.3712980 0.3083562 2.728877
## CA 2.361325e+03 2.26374838 3.44384968 5.1704175 4.3071336 17.232007
## CF 1.504379e+02 0.08432564 0.22803331 0.4776179 0.3528256 2.825774
## CO 4.854912e+02 1.23486238 1.48426928 2.0351814 1.7597254 8.478047
## KM 1.045269e+02 0.53185125 0.31250447 0.4654681 0.3889863 3.007009
## CG 1.088788e+02 0.66491803 0.20761885 0.3678366 0.2877278 2.681720
## HR 5.487358e+02 1.40989932 3.64181309 7.4858273 5.5638202 20.445433
## CZ 8.550970e+02 1.48902061 2.83741960 5.3461832 4.0918014 19.420877
## DK 1.980182e+03 1.99324531 3.56907492 5.4657626 4.5174188 19.812953
## DJ 2.812539e+03 1.29603122 0.51375834 0.7060595 0.6099089 4.527579
## DO 1.479510e+03 1.65899033 1.41201959 1.7626442 1.5873319 7.082817
## EC 2.230286e+03 2.28487232 1.31184512 1.7634434 1.5376442 7.157290
## EG 1.998098e+02 0.96804820 0.59376508 0.9883030 0.7910340 5.229779
## SV 3.284666e+02 0.84966889 1.64624432 2.0376142 1.8419292 8.287090
## GQ 7.968073e+02 1.00721356 0.23244491 0.3448975 0.2886712 2.457877
## EE 1.393007e+03 1.70728513 3.14651675 7.9517097 5.5491132 19.626357
## ET 6.692634e+00 0.02322475 0.45453976 0.5479606 0.5012502 3.501133
## FJ 2.037391e+01 0.00000000 0.47150751 0.6876126 0.5795601 5.449680
## FI 1.212747e+03 1.76134842 3.92274373 6.8888011 5.4057724 21.720788
## FR 2.175728e+03 2.63132934 4.56728528 7.6391664 6.1032258 20.034625
## GA 1.094242e+03 0.88115819 0.38531522 0.6817970 0.5335561 3.563907
## GM 1.096442e+01 0.15793307 0.24379309 0.2753184 0.2595557 2.589981
## GE 1.969981e+02 0.62493108 2.51953653 4.8459528 3.6827447 14.865491
## DE 2.167147e+03 2.01040779 5.07035282 8.1838074 6.6270801 21.461962
## GH 2.453379e+02 0.33086008 0.27996116 0.3732648 0.3266130 3.068898
## EL 2.706087e+02 1.23366924 6.13905854 8.3967659 7.2679122 21.655272
## GT 2.403204e+02 0.69394933 0.93517499 1.1745195 1.0548473 4.812073
## GN 2.775827e+02 0.43000974 0.25836523 0.3807578 0.3195615 2.926022
## GY 1.784330e+02 1.17956888 1.07800787 1.4664646 1.2722362 6.450271
## HT 1.186711e+02 0.60817085 0.68159397 0.9736716 0.8276328 4.949404
## HN 4.839624e+02 1.32704478 0.85537137 1.2034197 1.0293956 4.690618
## HU 3.906320e+02 1.72513328 2.66613364 5.8764855 4.2713096 19.157725
## TD 4.619534e+01 0.71053771 0.26534733 0.3608357 0.3130915 2.480519
## CL 4.393630e+03 1.66184336 1.98522693 3.4164040 2.7008155 11.529802
## CN 6.038931e+01 0.63650295 1.39566195 2.1799124 1.7877871 10.920884
## IN 1.170568e+02 0.63846947 0.81547194 1.0741411 0.9448065 6.179956
## ID 8.910817e+01 0.81312576 0.63862200 1.0737409 0.8561815 5.857166
## IR 1.730936e+03 1.97066822 1.27963767 0.9669791 1.1233084 6.184574
## IQ 1.336071e+02 0.74455172 0.37591930 0.5902882 0.4831038 3.323600
## IE 5.110326e+03 2.52768884 2.50008058 3.5376243 3.0188525 13.865802
## IL 1.890295e+03 1.51362517 2.41256950 3.6798039 3.0461867 11.976986
## IT 3.824824e+03 2.73899149 5.48160915 8.8652623 7.1734357 22.751680
## JM 1.938767e+02 0.60923050 1.93886184 2.1524976 2.0456797 8.796643
## JP 1.315982e+02 0.89103814 6.16625352 10.5564415 8.3613475 27.576370
## JO 7.231812e+01 0.27966158 0.53354023 0.6712123 0.6023762 3.846490
## KZ 5.239516e+02 0.48064752 0.91633260 2.0700761 1.4932044 7.391846
## KE 2.862257e+01 0.31600904 0.19255206 0.3472758 0.2699139 2.339187
## KW 5.623704e+03 1.63646809 0.20842979 0.2570540 0.2327419 2.550472
## LV 5.486514e+02 1.11188355 3.14242031 7.9881716 5.5652960 20.043620
## LB 1.695157e+02 0.68089875 1.19514163 1.7705697 1.4828557 7.002368
## LS 9.487072e-01 0.00000000 0.37851920 1.2632823 0.8209008 4.901087
## LR 5.519844e+01 0.81973136 0.33809045 0.4611975 0.3996440 3.253432
## LY 1.482354e+01 0.20382969 0.62399259 0.8970569 0.7605248 4.392040
## LT 5.904214e+02 1.39199086 3.50274874 8.1713074 5.8370281 19.705033
## LU 6.583537e+03 2.26007623 3.00125285 5.0458011 4.0235270 14.183154
## MG 2.330331e+01 0.03187466 0.38401050 0.4643295 0.4241700 2.986717
## MW 5.566789e+00 0.08652600 0.20543741 0.4120391 0.3087382 2.645435
## MY 2.416537e+02 0.66721788 1.01429906 1.1340407 1.0741699 6.671755
## ML 5.849765e+01 0.66924316 0.24060395 0.2961390 0.2683715 2.507230
## MR 6.631361e+01 0.66592067 0.32220470 0.5186323 0.4204185 3.141112
## MU 2.639684e+02 0.94954834 1.45222816 2.5933641 2.0227961 11.474173
## MX 6.182939e+02 1.83964772 1.32388392 1.7807238 1.5523039 7.223685
## MD 2.125564e+03 1.89361039 1.43488921 3.0996156 2.2672524 11.469556
## MN 5.078531e+01 0.00000000 0.44312835 0.8136545 0.6283914 4.083539
## ME 5.206116e+02 1.18924972 2.64987500 4.1910961 3.4204855 14.974937
## MA 2.109681e+02 0.81997625 0.89534738 1.4420998 1.1687236 7.012905
## MZ 7.695969e+00 0.01447977 0.22502107 0.4712336 0.3481273 2.890764
## MM 3.835527e+00 0.04599322 0.57207835 0.9861366 0.7791075 5.784642
## NM 8.985992e+00 0.00000000 0.40544266 0.8249161 0.6151794 3.636032
## NP 3.154386e+01 0.05782208 0.73815416 0.7650848 0.7516195 5.727671
## NL 2.656140e+03 2.53367393 3.64646480 5.7488137 4.6976392 19.196193
## NZ 2.362092e+02 0.74060910 3.17823477 4.2839926 3.7311137 15.652425
## NI 1.173921e+02 0.80708405 0.87536492 1.3297727 1.1025688 5.247497
## NE 4.255234e+01 0.58564967 0.20098806 0.2671884 0.2340882 2.595008
## NO 1.577431e+03 1.65533067 3.20399502 5.2423112 4.2231531 17.049222
## OM 1.733726e+03 0.94784219 0.29164290 0.6276245 0.4596337 2.392787
## PK 2.885140e+02 0.84119511 0.66816849 0.6409555 0.6545620 4.312774
## PA 2.807842e+03 1.88318015 1.69079701 2.1502704 1.9205337 8.104731
## PY 1.270832e+02 0.41184731 1.01873059 1.4083568 1.2135437 6.430215
## PE 4.248458e+03 2.09868025 1.46155999 1.9002429 1.6809015 8.088393
## PH 1.411039e+02 0.97663292 0.52949911 1.0492596 0.7893793 5.122569
## PL 5.917288e+02 1.44821011 2.90312619 6.0231067 4.4631164 17.517817
## PT 3.043447e+03 2.12347272 4.92825496 7.7534849 6.3408699 21.953858
## QA 1.759622e+04 1.07132447 0.08736843 0.2820742 0.1847213 1.370070
## RO 9.548147e+02 1.80343313 3.42296861 5.9939190 4.7084438 18.338701
## RW 2.812565e+01 0.00000000 0.28365324 0.4412880 0.3624706 2.938196
## VC 1.633246e+02 0.00000000 2.20804973 2.6884001 2.4482249 9.589787
## SA 2.330597e+03 1.13389947 0.39373448 0.6139561 0.5038453 3.314088
## SN 2.051802e+02 0.53906244 0.31785259 0.4472135 0.3825330 3.086824
## RS 1.614847e+03 1.54868038 3.14271267 4.8955145 4.0191136 18.345793
## SL 1.022202e+02 0.83772947 0.27619394 0.4282340 0.3522140 2.966556
## SG 5.830447e+03 0.70577580 1.57583078 2.7774882 2.1766595 11.463380
## SK 2.781342e+02 0.78819906 2.06381766 4.3809082 3.2223629 15.629247
## SI 7.115314e+02 1.72227622 3.49460207 7.1359265 5.3152643 19.606880
## ZA 4.488953e+02 1.02339821 0.46387285 0.9730718 0.7184723 5.318005
## KR 2.196949e+02 0.79306494 2.07437980 4.3497052 3.2120425 14.418556
## ES 5.067423e+03 2.76446761 4.67746877 7.6569426 6.1672057 19.378508
## LK 6.778957e+01 0.16478915 1.29445871 1.9186975 1.6065781 10.473220
## SE 3.445684e+03 2.61847597 4.08274767 6.2624588 5.1726032 20.095525
## CH 3.602166e+03 2.28867018 3.98029809 6.3184688 5.1493834 18.623217
## TJ 3.406280e+02 0.78207686 0.44981821 0.5970683 0.5234433 3.021888
## TH 4.398768e+01 0.26030714 2.07568057 2.9874503 2.5315654 11.900893
## TG 5.006912e+01 0.42289247 0.23607069 0.3039569 0.2700138 2.869468
## TN 9.087605e+01 0.71183934 1.43186270 2.0076257 1.7197442 8.315679
## TR 1.928602e+03 1.73570816 1.25823610 2.0967233 1.6774797 8.483213
## UG 6.577232e+00 0.00000000 0.13547819 0.2760308 0.2057545 1.940987
## UA 4.837020e+02 1.18842716 2.37050281 5.6047403 3.9876216 16.434686
## AE 3.319399e+03 1.43897112 0.09768939 0.1638645 0.1307769 1.085001
## UK 4.019312e+03 2.75158819 4.13800199 5.9184161 5.0282090 18.395866
## US 5.195911e+03 2.48855760 3.10021646 4.6499908 3.8751036 15.807654
## UY 2.328009e+02 0.86794498 2.71338358 6.0761446 4.3947641 14.814520
## UZ 1.011367e+02 0.15375896 0.62822093 1.0455867 0.8369038 4.419138
## YE 8.947781e+00 0.45632576 0.28362786 0.4161354 0.3498816 2.876270
## ZM 6.091579e+01 0.14718638 0.15468651 0.3512552 0.2529708 2.099678
## ZW 9.141896e+00 0.10620013 0.24497323 0.5995746 0.4222739 2.939524
## PoblaMid PoblaData PoblaDens Mujeres Urbano ExpectVida NeontlMort
## AF 54.32490 0.37172386 0.56937760 48.63585 25.495 62.701 37.1
## AL 68.58239 0.02866376 1.04612263 49.06309 60.319 76.601 6.5
## DZ 63.48882 0.42228429 0.17730075 49.48427 72.629 75.307 14.6
## AO 50.97470 0.30809762 0.24713052 50.53046 65.514 57.677 28.5
## AR 64.12128 0.44494502 0.16258510 51.23735 91.870 72.924 6.4
## AM 68.11276 0.02951776 1.03680225 52.95658 63.149 71.115 6.5
## AU 65.15291 0.24992369 0.03249129 50.19962 86.012 80.400 2.3
## AT 66.70049 0.08847037 1.07206927 50.82943 58.297 79.300 2.1
## AZ 70.43525 0.09942334 1.20265320 50.11575 55.680 70.128 11.2
## BD 67.13559 1.61356039 12.39579312 49.38730 36.632 70.409 17.1
## BY 68.28891 0.09485386 0.46728800 53.45605 78.595 69.300 1.3
## BE 64.15583 0.11422068 3.77214927 50.59332 98.001 79.000 2.0
## BZ 64.98378 0.00383071 0.16793994 50.19252 45.724 71.533 8.6
## BJ 54.29871 0.11485048 1.01853920 50.09820 47.312 59.633 31.3
## BT 68.22563 0.00754394 0.19777528 47.00264 40.895 70.822 16.4
## BO 61.73450 0.11353142 0.10480146 49.78340 69.425 68.173 14.3
## BA 68.76346 0.03323929 0.64920488 51.01054 48.245 74.622 4.1
## BW 61.66318 0.02254126 0.03977425 51.73076 69.446 65.790 24.5
## BR 69.74309 2.09469333 0.25061716 50.82992 86.569 71.804 8.1
## BN 72.10039 0.00428962 0.81396964 48.03618 77.629 74.454 5.5
## BG 64.38262 0.07024216 0.64703537 51.41409 75.008 71.300 3.6
## BF 52.64494 0.19751535 0.72191283 50.09548 29.358 59.981 24.7
## BI 52.25138 0.11175378 4.35178271 50.42199 13.032 59.092 21.7
## KH 64.22991 0.16249798 0.92056413 51.19798 23.388 67.062 14.4
## CM 54.63954 0.25216237 0.53343989 50.00349 56.374 57.235 26.6
## CA 66.89774 0.37058856 0.04075308 50.39153 81.411 80.288 3.4
## CF 52.87991 0.04666377 0.07490412 50.43647 41.364 50.152 41.2
## CO 68.44406 0.49648685 0.44748702 50.92577 80.778 74.124 7.8
## KM 57.45457 0.00832322 4.47244478 49.55870 28.965 62.210 31.6
## CG 55.55478 0.05244363 0.15356846 50.06560 66.916 62.546 20.3
## HR 65.04263 0.04089400 0.73077198 51.85262 56.947 74.900 2.6
## CZ 64.99252 0.10625695 1.37602888 50.80859 73.792 76.500 1.8
## DK 63.72878 0.05797446 1.38067302 50.27420 87.874 79.200 3.1
## DJ 65.89830 0.00958920 0.41368421 47.36679 77.777 64.000 31.7
## DO 64.94005 0.10627165 2.19978576 50.00780 81.074 70.609 19.4
## EC 64.81412 0.17084357 0.68788682 49.97063 63.821 73.833 7.2
## EG 60.97150 0.98423595 0.98873469 49.46997 42.704 69.453 11.2
## SV 64.58083 0.06420744 3.09881467 53.11400 72.023 68.006 6.7
## GQ 60.42552 0.01308974 0.46665740 44.45585 72.143 57.059 29.9
## EE 64.01657 0.01320884 0.30386105 52.85843 68.880 73.300 1.2
## ET 55.71589 1.09224559 1.09224559 49.97889 20.763 63.997 28.1
## FJ 65.03770 0.00883483 0.48357033 49.30050 56.248 65.594 10.9
## FI 62.13403 0.05518050 0.18156856 50.72076 85.382 78.600 1.0
## FR 62.00891 0.66987244 1.22338396 51.58424 80.444 79.500 2.5
## GA 59.41022 0.02119275 0.08224764 49.06862 89.370 63.879 21.0
## GM 53.14127 0.02280102 2.25306522 50.40213 61.270 60.088 26.3
## GE 65.33927 0.03731000 0.65275202 52.29124 58.632 68.980 5.9
## DE 64.91701 0.82927922 2.37370970 50.66037 77.312 78.600 2.2
## GH 59.33504 0.29767108 1.30821429 49.32583 56.060 62.437 23.9
## EL 64.27348 0.10727668 0.83224732 50.91620 79.058 78.900 2.6
## GT 60.75253 0.17247807 1.60953779 50.75935 51.054 70.830 12.3
## GN 53.22380 0.12414318 0.50522212 51.82111 36.140 60.040 31.1
## GY 65.33518 0.00779004 0.03957348 49.80802 26.606 66.605 18.2
## HT 61.80835 0.11123176 4.03598549 50.65221 55.278 61.139 26.0
## HN 63.56850 0.09587522 0.85687032 50.04934 57.096 72.573 9.6
## HU 66.43028 0.09768785 1.07906606 52.43243 71.351 72.600 2.3
## TD 50.39318 0.15477751 0.12291734 50.08490 23.059 52.315 34.2
## CL 68.71630 0.18729160 0.25189446 50.72703 87.564 77.333 4.9
## CN 71.20211 13.92730000 1.48348833 48.67937 59.152 74.315 4.3
## IN 66.76674 13.52617328 4.54938073 48.02354 34.030 68.000 22.7
## ID 67.59164 2.67663435 1.47752190 49.64388 55.325 69.156 12.7
## IR 69.33887 0.81800269 0.50222420 49.43913 74.898 75.217 8.9
## IQ 58.28983 0.38433600 0.88530570 49.40868 70.473 68.277 15.3
## IE 64.72778 0.04853506 0.70452983 50.42551 63.170 80.200 2.3
## IL 60.09777 0.08883800 4.10526802 50.29813 92.418 80.700 1.9
## IT 63.91920 0.60431283 2.05450748 51.37667 70.438 81.000 2.0
## JM 67.45326 0.02934855 2.70993075 50.33983 55.674 72.708 10.2
## JP 59.72678 1.26529100 3.47073458 51.15926 91.616 81.090 0.9
## JO 61.90802 0.09956011 1.12142498 49.38968 90.979 72.628 9.5
## KZ 64.14760 0.18276499 0.06769826 51.51148 57.428 68.720 5.6
## KE 57.87865 0.51393010 0.90299417 50.31602 27.030 63.539 19.6
## KW 75.91064 0.04137309 2.32172222 39.54817 100.000 74.584 4.5
## LV 63.96060 0.01926542 0.30983307 54.01017 68.142 69.900 2.0
## LB 66.90176 0.06848925 6.69494135 49.70581 88.593 77.031 4.3
## LS 62.38256 0.02108132 0.69437813 50.71690 28.153 49.837 34.9
## LR 55.62158 0.04818977 0.50030907 49.76829 51.151 61.911 24.5
## LY 67.28872 0.06678567 0.03795632 49.48379 80.102 69.672 6.4
## LT 65.41254 0.02789533 0.44531351 53.79196 67.679 69.500 2.1
## LU 69.93802 0.00607728 2.50093827 49.53926 90.981 80.100 1.4
## MG 56.34513 0.26262368 0.45139856 50.12397 37.191 64.728 20.6
## MW 53.45228 0.18143315 1.92440762 50.70152 16.937 60.155 22.4
## MY 69.33310 0.31528585 0.95962821 48.57852 76.036 73.903 4.3
## ML 49.94928 0.19077690 0.15635016 49.94100 42.356 57.718 32.7
## MR 56.77571 0.04403319 0.04272164 49.82266 53.672 62.831 33.5
## MU 70.73213 0.01265303 6.23301970 50.57711 40.793 71.300 9.2
## MX 66.21947 1.26190788 0.64914626 51.08928 80.156 72.046 7.5
## MD 72.67035 0.03545883 1.23519804 52.03556 42.629 67.439 11.9
## MN 65.50689 0.03170208 0.02040609 50.66954 68.445 65.465 8.7
## ME 66.81554 0.00622345 0.46271004 50.55901 66.813 74.205 1.7
## MA 65.78072 0.36029138 0.80728519 50.40385 62.453 74.948 13.8
## MZ 52.43844 0.29495962 0.37508535 51.47519 35.988 56.293 27.8
## MM 67.84431 0.53708395 0.82238615 51.80790 30.579 63.419 23.1
## NM 59.45372 0.02448255 0.02973746 51.55369 50.032 60.020 15.6
## NP 63.85806 0.28087871 1.95939107 54.53534 19.740 68.710 19.9
## NL 64.69565 0.17231017 5.11457910 50.22094 91.490 80.000 2.1
## NZ 64.69414 0.04885500 0.18554176 50.83777 86.538 80.000 3.5
## NI 64.55082 0.06465513 0.53727048 50.71271 58.522 70.551 9.4
## NE 47.42067 0.22442948 0.17717651 49.77100 16.425 60.485 25.2
## NO 65.40174 0.05314336 0.14554920 49.52463 82.248 80.900 1.5
## OM 75.36071 0.04829483 0.15604145 34.01408 84.539 75.645 5.1
## PK 60.41741 2.12215030 2.75289319 48.53807 36.666 66.041 42.0
## PA 64.83296 0.04176873 0.56186077 49.90538 67.709 75.060 8.5
## PY 64.12928 0.06956071 0.17508359 49.15161 61.585 72.041 10.7
## PE 66.12100 0.31989256 0.24991606 50.33776 77.907 73.612 7.3
## PH 63.91439 1.06651922 3.57688305 49.74166 46.907 66.971 13.5
## PL 67.42991 0.37978548 1.24035886 51.53071 60.058 73.900 2.7
## PT 64.58823 0.10281762 1.12239454 52.71196 65.211 78.100 2.1
## QA 85.08917 0.02781677 2.39593196 24.49529 99.135 78.830 3.5
## RO 66.12674 0.19473936 0.84639847 51.34374 53.998 71.700 3.4
## RW 57.08623 0.12301939 4.98659870 50.86106 17.211 66.187 15.9
## VC 67.86891 0.00110210 2.82589744 49.20878 52.198 70.075 9.7
## SA 71.64306 0.33699947 0.15676654 42.44585 83.844 73.671 3.7
## SN 53.85775 0.15854360 0.82347478 51.27733 47.192 65.242 20.6
## RS 65.96453 0.06982084 0.79831740 51.00252 56.092 73.600 3.4
## SL 55.97380 0.07650154 1.05987171 50.12127 42.055 53.049 32.8
## SG 76.25834 0.05638676 79.52998418 47.65813 100.000 80.700 1.1
## SK 68.92462 0.05447011 1.13290578 51.33833 53.726 73.800 2.8
## SI 65.37135 0.02067372 1.02639860 50.24521 54.541 78.200 1.2
## ZA 65.60251 0.57779622 0.47630120 50.69415 66.355 60.162 10.7
## KR 72.60812 0.51635256 5.29652104 49.91688 81.459 79.700 1.5
## ES 65.95449 0.46723749 0.93529058 50.89664 80.321 80.500 1.7
## LK 65.32978 0.21670000 3.45558922 51.96682 18.476 73.238 4.5
## SE 62.32269 0.10183175 0.25001043 49.94578 87.431 80.600 1.5
## CH 66.46583 0.08516543 2.15521378 50.42712 73.797 81.700 2.9
## TJ 60.19383 0.09100837 0.65572714 49.58384 27.134 68.493 15.0
## TH 71.01212 0.69428524 1.35897207 51.26870 49.949 72.977 5.0
## TG 55.79601 0.07889094 1.45046773 50.26805 41.702 59.644 24.9
## TN 67.51420 0.11565204 0.74441323 50.43715 68.945 74.297 11.5
## TR 66.86738 0.82319724 1.06960129 50.67781 75.143 74.149 5.5
## UG 51.12849 0.42723139 2.13061734 50.77608 23.774 60.270 19.9
## UA 67.75290 0.44622516 0.77029667 53.68775 69.352 67.020 5.2
## AE 84.31149 0.09630959 1.35609110 30.63669 86.522 76.966 4.0
## UK 63.92605 0.66488991 2.74827392 50.63527 83.398 79.400 2.6
## US 65.48331 3.27167434 0.35766089 50.52001 82.256 76.100 3.5
## UY 64.57750 0.03449299 0.19708028 51.72154 95.334 73.805 4.5
## UZ 66.89480 0.32955400 0.77469205 50.13736 50.478 69.250 11.6
## YE 57.50884 0.28498687 0.53977853 49.61166 36.642 64.413 27.0
## ZM 52.96418 0.17351822 0.23341479 50.49321 43.521 60.158 23.5
## ZW 54.65941 0.14439018 0.37324591 52.35675 32.209 59.105 20.9
## DisMort Lesion EnfNoTrans EnfTrans PBI Tuberculosis Diabetes
## AF 29.8 19.5 44.1 36.4 1.8351696 189.0 9.2
## AL 17.0 4.0 93.1 2.9 11.3351950 18.0 9.0
## DZ 14.2 9.5 75.7 14.8 14.1967389 69.0 6.7
## AO 16.5 9.2 27.4 63.4 6.7205961 355.0 4.5
## AR 15.8 6.5 77.6 15.9 20.0684923 27.0 5.9
## AM 22.3 3.9 93.3 2.8 8.3491802 31.0 6.1
## AU 9.1 5.9 89.5 4.6 45.7525548 6.6 5.6
## AT 11.4 5.2 92.2 2.6 48.9687140 7.1 6.6
## AZ 22.2 4.6 86.6 8.8 17.0906963 63.0 6.1
## BD 21.6 7.5 66.9 25.6 3.3061083 221.0 9.2
## BY 23.7 7.0 90.5 2.5 18.1721809 31.0 5.0
## BE 11.4 6.4 85.7 7.9 45.2631622 9.0 4.6
## BZ 22.1 13.2 67.4 19.4 8.0937796 30.0 17.1
## BJ 19.6 10.2 35.7 54.1 2.0675705 56.0 1.0
## BT 23.3 10.5 68.6 20.9 8.3417246 149.0 10.3
## BO 17.2 13.1 64.5 22.4 6.5317860 108.0 6.8
## BA 17.8 3.7 94.5 1.8 11.6971771 25.0 9.0
## BW 20.3 8.3 45.7 46.0 16.1336867 275.0 5.8
## BR 16.6 12.2 73.9 13.9 15.5847506 45.0 10.4
## BN 16.6 7.4 84.8 7.8 80.8004129 68.0 13.3
## BG 23.6 2.6 95.2 2.2 17.9465777 22.0 6.0
## BF 21.7 11.0 32.7 56.3 1.6709928 48.0 7.3
## BI 22.9 12.1 32.1 55.8 0.7568378 111.0 5.1
## KH 21.1 10.0 64.4 25.6 3.3333517 302.0 6.4
## CM 21.6 10.9 35.2 53.9 3.2930885 186.0 6.0
## CA 9.8 6.1 88.3 5.6 44.2264907 5.6 7.6
## CF 23.1 10.3 26.0 63.7 0.8532664 540.0 6.0
## CO 15.8 15.0 74.8 10.1 13.2116325 33.0 7.4
## KM 22.9 10.9 41.7 47.4 2.6420144 35.0 12.3
## CG 16.7 9.9 34.6 55.5 5.6636489 375.0 6.0
## HR 16.7 5.3 92.4 2.3 22.9922117 8.4 5.4
## CZ 15.0 4.7 89.9 5.4 32.7718057 5.4 7.0
## DK 11.3 3.8 89.7 6.5 48.5249925 5.4 8.3
## DJ 19.6 10.4 44.4 45.2 2.7442687 260.0 5.1
## DO 19.0 12.0 72.3 15.8 13.9050879 45.0 8.6
## EC 13.0 12.8 72.2 15.1 10.8759023 44.0 5.5
## EG 27.7 5.8 84.1 10.2 10.8110341 12.0 17.2
## SV 14.0 15.4 73.8 10.8 7.2348467 70.0 8.8
## GQ 22.0 10.7 35.9 53.4 30.5908474 201.0 6.0
## EE 17.0 4.5 92.7 2.8 28.8340001 13.0 4.2
## ET 18.3 11.7 39.3 49.0 1.5126247 151.0 4.3
## FJ 30.6 5.4 84.4 10.1 8.8754441 54.0 14.7
## FI 10.2 5.5 93.2 1.3 42.8552430 4.7 5.6
## FR 10.6 6.4 87.6 6.0 40.3515680 8.9 4.8
## GA 14.4 9.1 41.0 49.9 17.0778163 525.0 6.0
## GM 20.4 10.9 34.3 54.8 2.4051919 174.0 1.9
## GE 24.9 3.6 93.7 2.7 9.5834608 80.0 5.8
## DE 12.1 4.0 91.2 4.8 46.5762068 7.3 10.4
## GH 20.8 9.8 42.7 47.5 3.9219764 148.0 2.5
## EL 12.4 2.9 86.2 10.9 27.2065489 4.5 4.7
## GT 14.9 15.7 59.2 25.1 7.5159291 26.0 10.0
## GN 22.4 9.2 35.1 55.7 2.0022876 176.0 2.4
## GY 30.5 12.4 67.6 20.0 7.1987245 83.0 11.6
## HT 26.5 12.6 57.1 30.3 1.7058976 176.0 6.7
## HN 14.0 19.6 66.5 14.0 4.4336960 37.0 7.3
## HU 23.0 4.4 93.8 1.8 25.7573736 6.4 6.9
## TD 23.9 9.3 27.3 63.4 2.0073216 142.0 6.0
## CL 12.4 7.1 84.7 8.1 22.2523960 18.0 8.6
## CN 17.0 7.0 89.3 3.8 13.5313781 61.0 9.2
## IN 23.3 11.3 62.7 26.0 5.8366566 199.0 10.4
## ID 26.4 6.0 73.3 20.7 10.5772045 316.0 6.3
## IR 14.8 10.1 81.9 7.9 18.4501839 14.0 9.6
## IQ 21.3 28.4 54.7 16.8 15.8895142 42.0 8.8
## IE 10.3 4.3 90.6 5.1 59.3055780 7.0 3.2
## IL 9.6 4.1 85.8 10.0 34.5710854 4.0 9.7
## IT 9.5 3.8 91.4 4.9 37.7630816 7.0 5.0
## JM 14.7 8.7 80.0 11.2 8.5085469 2.9 11.3
## JP 8.4 4.8 82.4 12.7 39.1530060 14.0 5.6
## JO 19.2 10.9 78.4 10.7 9.2014965 5.0 12.7
## KZ 26.8 9.5 86.0 4.5 24.1030338 68.0 6.1
## KE 13.4 9.6 27.1 63.3 2.8839337 292.0 3.1
## KW 17.4 12.8 72.4 14.8 75.8307296 23.0 12.2
## LV 21.9 5.4 91.8 2.7 23.8146826 29.0 5.0
## LB 17.9 5.8 90.6 3.6 13.2450688 11.0 11.2
## LS 26.6 8.3 32.3 59.3 2.9043623 611.0 4.5
## LR 17.6 10.0 31.4 58.5 1.2563111 308.0 2.4
## LY 20.1 20.1 71.9 8.0 19.3396159 40.0 10.2
## LT 20.7 6.6 89.8 3.6 27.8087523 44.0 3.8
## LU 10.0 6.7 88.4 4.9 100.2191161 8.0 5.0
## MG 22.9 10.6 43.2 46.2 1.7044431 233.0 4.5
## MW 16.4 8.6 31.7 59.7 1.1836484 181.0 4.5
## MY 17.2 8.9 73.6 17.5 25.8714034 92.0 16.7
## ML 24.6 8.9 30.5 60.6 2.0131236 53.0 2.4
## MR 18.1 9.4 37.2 53.4 3.8172107 93.0 7.1
## MU 22.6 4.8 88.7 6.5 19.3987280 13.0 22.0
## MX 15.7 10.3 79.9 9.8 17.8555895 23.0 13.5
## MD 24.9 5.7 90.1 4.2 5.8933274 86.0 5.7
## MN 30.2 10.6 79.7 9.7 11.1277975 428.0 4.7
## ME 20.6 3.5 95.0 1.4 16.2734892 15.0 9.0
## MA 12.4 6.4 79.6 14.0 7.4795258 99.0 7.0
## MZ 18.4 7.8 26.9 65.3 1.2616857 551.0 3.3
## MM 24.2 8.6 67.8 23.6 5.0214146 338.0 3.9
## NM 21.3 9.8 40.9 49.3 10.2230967 524.0 4.5
## NP 21.8 8.8 66.2 25.0 2.4752041 151.0 7.2
## NL 11.2 5.2 89.6 5.2 49.9843155 5.3 5.4
## NZ 10.1 6.0 89.5 4.6 36.4995043 7.3 6.2
## NI 14.2 12.7 76.4 10.9 4.8837325 41.0 11.4
## NE 20.0 10.4 27.0 62.7 0.9278714 87.0 2.4
## NO 9.2 5.6 87.0 7.3 62.6503184 4.1 5.3
## OM 17.8 17.7 71.9 10.5 42.4790524 5.9 10.1
## PK 24.7 7.3 57.8 34.9 4.6501098 265.0 19.9
## PA 13.0 9.7 74.6 15.6 20.8839055 52.0 7.7
## PY 17.5 12.0 74.4 13.7 11.4029323 43.0 9.6
## PE 12.6 10.5 69.2 20.3 12.3515166 123.0 6.6
## PH 26.8 7.5 67.3 25.2 7.0082665 554.0 7.1
## PL 18.7 4.7 90.3 5.0 25.9904310 16.0 6.1
## PT 11.1 4.2 85.6 10.2 29.3390041 24.0 9.8
## QA 15.3 25.9 68.9 5.2 123.2139364 31.0 15.6
## RO 21.4 3.6 92.2 4.2 21.6182719 68.0 6.9
## RW 18.2 13.5 44.0 42.4 1.7889788 59.0 5.1
## VC 23.2 5.6 81.0 13.4 10.9317631 6.3 11.6
## SA 16.4 16.3 73.2 10.6 51.5878305 10.0 15.8
## SN 18.1 12.2 42.1 45.7 3.1310271 118.0 2.4
## RS 19.1 3.0 94.6 2.4 14.9080484 17.0 9.0
## SL 30.5 8.9 33.2 57.9 1.4959394 298.0 2.4
## SG 9.3 3.7 73.6 22.7 86.0684237 47.0 5.5
## SK 17.2 6.0 89.2 4.8 29.0915206 5.8 6.5
## SI 12.7 6.6 88.4 5.0 31.7402860 5.3 5.9
## ZA 26.2 9.1 51.3 39.6 12.8666891 520.0 12.7
## KR 7.8 10.0 79.8 10.1 34.6370853 66.0 6.9
## ES 9.9 3.5 91.4 5.1 34.5888453 9.4 6.9
## LK 17.4 9.7 82.8 7.5 11.1185327 64.0 10.7
## SE 9.1 4.9 89.9 5.2 47.6285919 5.5 4.8
## CH 8.6 6.1 89.6 4.3 61.3146089 6.4 5.7
## TJ 25.3 7.6 69.2 23.2 2.7293337 84.0 6.1
## TH 14.5 10.2 74.0 15.8 15.8571484 153.0 7.0
## TG 23.6 10.7 37.6 51.7 1.4956789 36.0 2.4
## TN 16.1 6.4 85.8 7.8 11.2660561 35.0 8.5
## TR 16.1 6.2 89.4 4.4 23.5212137 16.0 11.1
## UG 21.9 12.7 32.9 54.5 1.8103287 200.0 2.5
## UA 24.7 5.0 91.0 4.1 8.4417522 80.0 6.1
## AE 16.8 16.8 76.8 6.5 65.5180899 1.0 16.3
## UK 10.9 3.5 88.8 7.7 41.1611271 8.0 3.9
## US 14.6 6.6 88.3 5.2 55.0581658 3.0 10.8
## UY 16.7 7.5 84.9 7.6 20.4797528 33.0 7.3
## UZ 24.5 6.0 83.7 10.3 6.8361061 70.0 6.5
## YE 30.6 14.7 56.6 28.7 3.5314239 48.0 5.4
## ZM 17.9 10.2 29.2 60.6 3.8025013 346.0 4.5
## ZW 19.3 12.3 33.0 54.6 2.5606953 210.0 1.8
## Medicos Camas ImmunSaramp TempMarzo HipTen.H HipTen.M HipTen BCG
## AF 0.24009091 0.4363636 64 7.60 18.6 19.8 19.20 1
## AL 1.21237143 2.9375000 94 6.04 41.6 39.4 40.50 1
## DZ 1.31202500 1.9000000 80 17.91 22.3 23.0 22.65 1
## AO 0.17300000 0.8000000 50 22.78 31.1 25.2 28.15 1
## AR 3.57165000 4.6000000 94 17.51 41.8 32.9 37.35 1
## AM 3.06122500 4.0200000 95 -0.57 41.2 43.4 42.30 1
## AU 3.27402222 3.8783333 95 25.37 34.8 32.8 33.80 1
## AT 4.66801111 7.7000000 94 1.42 44.9 38.8 41.85 1
## AZ 3.58736250 6.4666667 96 4.97 25.9 31.4 28.65 1
## BD 0.39047692 0.5750000 97 25.42 15.2 17.4 16.30 1
## BY 4.22154000 11.2000000 97 -0.69 43.9 45.5 44.70 1
## BE 2.79814444 6.5500000 96 5.23 39.4 35.0 37.20 0
## BZ 0.96785000 1.1600000 97 24.45 24.3 25.1 24.70 1
## BJ 0.11874000 0.5000000 71 30.14 39.9 40.3 40.10 1
## BT 0.26431111 1.7333333 97 5.68 19.7 20.4 20.05 1
## BO 0.71612500 1.1000000 89 22.07 27.4 27.2 27.30 1
## BA 1.77503333 3.3666667 68 4.01 45.6 43.2 44.40 1
## BW 0.35774444 2.0000000 97 24.30 42.2 41.0 41.60 1
## BR 1.84654000 2.3285714 84 25.49 28.1 38.5 33.30 1
## BN 1.38302727 2.7542857 99 25.92 29.1 32.0 30.55 1
## BG 3.80887500 6.4888889 93 4.70 45.5 46.5 46.00 1
## BF 0.04237143 0.6500000 88 30.63 9.0 12.4 10.70 1
## BI 0.04885000 1.1333333 88 20.43 32.6 30.8 31.70 1
## KH 0.24971429 0.7600000 84 27.93 25.5 24.1 24.80 1
## CM 0.07534000 1.4000000 71 26.27 18.5 17.9 18.20 1
## CA 2.32944444 3.0714286 90 -18.72 22.7 23.9 23.30 0
## CF 0.04973333 1.1000000 49 26.96 33.6 33.2 33.40 1
## CO 1.70129231 1.3166667 95 25.14 28.7 28.7 28.70 1
## KM 0.18323333 2.2000000 90 25.20 43.6 41.5 42.55 1
## CG 0.12880000 1.6000000 75 25.60 18.2 19.3 18.75 1
## HR 2.80697000 5.6354545 93 5.83 43.7 38.5 41.10 1
## CZ 3.70292500 7.0100000 96 2.80 48.2 42.6 45.40 1
## DK 3.56958333 3.4111111 95 2.24 39.9 34.6 37.25 1
## DJ 0.21512500 1.4571429 86 25.75 19.8 22.3 21.05 1
## DO 1.37733333 1.4375000 95 22.88 27.4 29.3 28.35 1
## EC 1.90360000 1.5285714 83 21.93 28.5 28.6 28.55 1
## EG 1.73048750 1.5100000 94 17.83 17.1 23.9 20.50 1
## SV 1.65428000 0.9900000 81 25.70 27.1 30.0 28.55 1
## GQ 0.40000000 2.0666667 30 25.04 28.2 25.2 26.70 1
## EE 3.34070000 5.3600000 87 -2.35 45.5 42.9 44.20 1
## ET 0.03620000 1.7500000 61 23.48 27.5 22.2 24.85 1
## FJ 0.58042000 2.1475000 94 25.00 27.6 25.0 26.30 1
## FI 3.14394000 5.9600000 96 -6.09 54.6 46.6 50.60 1
## FR 3.26508571 6.9222222 90 6.37 38.0 38.5 38.25 1
## GA 0.36110000 3.2000000 59 26.14 44.7 43.6 44.15 1
## GM 0.09858333 1.0000000 91 27.32 33.0 30.4 31.70 1
## GE 4.62520000 3.1222222 98 0.72 40.2 41.0 40.60 1
## DE 3.84022000 8.2555556 97 3.87 35.6 34.2 34.90 1
## GH 0.12015714 0.9000000 92 29.52 41.5 41.4 41.45 1
## EL 5.71011111 4.6555556 97 8.19 39.2 36.4 37.80 1
## GT 0.62945000 0.6250000 87 22.94 25.6 26.5 26.05 1
## GN 0.09196667 0.3000000 48 27.63 40.6 41.0 40.80 1
## GY 0.56823333 2.1600000 98 25.65 26.2 26.3 26.25 1
## HT 0.18585000 1.0000000 69 23.47 25.5 26.7 26.10 1
## HN 0.57160000 0.7285714 89 23.38 25.5 25.7 25.60 1
## HU 3.24861667 7.3000000 99 5.44 46.2 47.4 46.80 1
## TD 0.04200000 0.4000000 37 26.55 32.7 31.3 32.00 1
## CL 1.03645000 2.1714286 93 10.87 31.7 28.2 29.95 1
## CN 1.57320000 3.4066667 99 0.49 35.7 32.3 34.00 1
## IN 0.67390833 0.8000000 90 23.45 25.8 29.2 27.50 1
## ID 0.24655000 0.9000000 75 25.79 25.0 24.7 24.85 1
## IR 0.98516000 1.4400000 99 11.33 26.4 25.9 26.15 1
## IQ 0.72533333 1.3100000 83 15.12 24.8 23.9 24.35 1
## IE 2.81283000 3.9555556 92 6.00 46.0 32.2 39.10 1
## IL 3.38105556 3.5333333 98 14.96 33.8 40.1 36.95 1
## IT 3.94927778 3.6875000 93 6.52 45.7 36.5 41.10 0
## JM 0.54227143 1.7571429 89 23.44 30.4 33.6 32.00 1
## JP 2.27806667 13.7960000 97 2.52 46.7 37.5 42.10 1
## JO 2.24923636 1.7818182 92 13.08 29.3 26.3 27.80 1
## KZ 3.60587000 7.4111111 99 -3.96 33.9 33.1 33.50 1
## KE 0.18122857 1.4000000 89 26.10 34.7 36.8 35.75 1
## KW 2.16873636 1.9800000 99 19.23 24.5 26.5 25.50 1
## LV 3.38225000 6.8111111 98 -1.37 44.7 36.7 40.70 1
## LB 2.55344444 3.3800000 82 10.39 30.6 29.6 30.10 0
## LS 0.06760000 1.3000000 90 15.13 17.5 35.0 26.25 1
## LR 0.02466667 0.7500000 91 26.44 39.9 40.3 40.10 1
## LY 1.98748333 3.6700000 97 17.76 23.4 23.6 23.50 1
## LT 4.08613000 7.1666667 92 -0.47 43.5 40.5 42.00 1
## LU 2.85313000 5.3727273 99 4.70 48.5 37.1 42.80 1
## MG 0.17360000 0.2500000 62 23.99 33.1 32.2 32.65 1
## MW 0.01767500 1.2000000 87 23.25 33.4 32.6 33.00 1
## MY 1.24358000 1.8312500 96 25.19 26.5 25.2 25.85 1
## ML 0.09575714 0.3333333 70 27.34 32.6 32.1 32.35 1
## MR 0.14066667 0.4000000 78 25.29 26.3 29.5 27.90 1
## MU 1.45775556 3.2333333 99 25.48 49.0 48.4 48.70 1
## MX 2.03156667 1.5888889 97 18.44 29.3 28.5 28.90 1
## MD 2.62560000 6.1666667 93 2.93 43.3 42.2 42.75 1
## MN 2.96358889 6.3266667 99 -8.80 37.3 30.6 33.95 1
## ME 2.08927778 4.0125000 58 2.53 43.4 41.9 42.65 1
## MA 0.63655000 0.9800000 99 13.09 33.5 33.0 33.25 1
## MZ 0.04688750 0.7666667 85 25.48 36.1 31.5 33.80 1
## MM 0.53712000 0.7500000 93 22.74 24.7 25.5 25.10 1
## NM 0.37305000 3.0000000 82 22.67 43.2 41.9 42.55 1
## NP 0.57297500 2.6500000 91 10.02 21.6 22.1 21.85 1
## NL 3.40828889 4.6000000 93 4.95 39.1 33.8 36.45 0
## NZ 2.70726000 2.5500000 92 13.60 36.4 30.9 33.65 1
## NI 0.74390000 0.9222222 99 24.95 25.4 26.2 25.80 1
## NE 0.03340000 0.3000000 77 26.01 33.8 32.4 33.10 1
## NO 4.21626667 4.2555556 96 -5.49 38.2 33.0 35.60 1
## OM 1.95183077 1.8600000 99 23.40 22.2 26.2 24.20 1
## PK 0.84727500 0.7200000 76 16.01 20.1 21.1 20.60 1
## PA 1.43397000 2.2888889 98 25.44 27.7 24.6 26.15 1
## PY 0.96393333 1.2857143 93 25.84 27.8 27.2 27.50 1
## PE 1.18280000 1.4875000 85 19.99 16.2 17.8 17.00 1
## PH 1.25186667 0.5833333 67 25.13 28.0 23.5 25.75 1
## PL 2.19399000 6.5222222 93 2.65 40.9 35.0 37.95 1
## PT 3.79097273 3.4222222 99 11.33 38.6 35.7 37.15 1
## QA 2.47302500 1.6400000 99 21.78 26.8 36.2 31.50 1
## RO 2.40146667 6.4555556 90 3.40 39.1 46.7 42.90 1
## RW 0.09168889 1.6000000 99 19.25 32.2 30.4 31.30 1
## VC 0.65870000 3.3000000 99 25.90 27.9 30.7 29.30 1
## SA 2.25626250 2.2500000 98 20.60 25.6 27.0 26.30 1
## SN 0.14020000 0.2000000 82 28.47 42.3 40.4 41.35 1
## RS 2.42901111 5.6125000 92 4.91 43.5 41.6 42.55 1
## SL 0.02050000 0.4000000 80 27.65 39.8 39.7 39.75 1
## SG 1.76859091 2.7457143 95 28.62 25.7 22.1 23.90 1
## SK 3.11790000 6.3400000 96 2.40 39.5 33.7 36.60 1
## SI 2.59476000 4.6555556 93 3.38 42.5 37.2 39.85 1
## ZA 0.76988750 2.8000000 70 21.10 47.0 45.9 46.45 1
## KR 2.05984615 10.6080000 98 3.66 28.6 23.5 26.05 1
## ES 4.15920000 3.1888889 97 8.60 44.0 37.1 40.55 1
## LK 0.77147000 3.5500000 99 27.03 23.0 25.8 24.40 1
## SE 4.03310000 2.7666667 97 -4.98 41.8 37.0 39.40 0
## CH 4.00455000 5.1222222 96 0.09 38.6 31.7 35.15 1
## TJ 1.78443333 5.2666667 98 -3.08 26.3 25.4 25.85 1
## TH 0.40473333 2.1000000 96 27.38 23.4 23.8 23.60 1
## TG 0.08897500 0.8000000 85 29.31 39.5 40.1 39.80 1
## TN 1.16097143 2.0545455 96 14.21 20.9 25.2 23.05 1
## TR 1.65210000 2.4555556 96 4.77 38.3 35.1 36.70 1
## UG 0.10457500 0.7500000 86 23.68 24.6 32.7 28.65 1
## UA 3.35196667 8.9222222 91 1.18 47.7 50.6 49.15 1
## AE 1.70489167 1.6777778 99 22.61 17.9 19.2 18.55 1
## UK 2.75287500 3.2111111 92 4.66 31.7 29.9 30.80 1
## US 2.52747500 3.0333333 92 0.06 31.1 31.8 31.45 0
## UY 4.16766000 2.5250000 97 21.26 37.5 38.8 38.15 1
## UZ 2.50781250 4.5888889 96 5.38 27.1 27.7 27.40 1
## YE 0.30986667 0.6900000 64 20.82 9.6 12.4 11.00 1
## ZM 0.08791250 1.9500000 94 22.90 27.2 27.4 27.30 1
## ZW 0.06561250 2.3500000 88 22.92 33.2 32.0 32.60 1
## BCGf Tiempo
## AF Yes 56
## AL Yes 69
## DZ Yes 57
## AO Yes 82
## AR Yes 64
## AM Yes 61
## AU Yes 25
## AT Yes 57
## AZ Yes 60
## BD Yes 69
## BY Yes 59
## BE No 35
## BZ Yes 84
## BJ Yes 77
## BT Yes 66
## BO Yes 72
## BA Yes 66
## BW Yes 92
## BR Yes 57
## BN Yes 70
## BG Yes 68
## BF Yes 71
## BI Yes 92
## KH Yes 28
## CM Yes 67
## CA No 26
## CF Yes 76
## CO Yes 67
## KM Yes 123
## CG Yes 76
## HR Yes 57
## CZ Yes 62
## DK Yes 58
## DJ Yes 79
## DO Yes 62
## EC Yes 61
## EG Yes 46
## SV Yes 79
## GQ Yes 75
## EE Yes 59
## ET Yes 74
## FJ Yes 80
## FI Yes 30
## FR Yes 25
## GA Yes 73
## GM Yes 78
## GE Yes 58
## DE Yes 28
## GH Yes 73
## EL Yes 58
## GT Yes 75
## GN Yes 74
## GY Yes 73
## HT Yes 80
## HN Yes 72
## HU Yes 65
## TD Yes 80
## CL Yes 64
## CN Yes 0
## IN Yes 30
## ID Yes 62
## IR Yes 51
## IQ Yes 56
## IE Yes 61
## IL Yes 53
## IT No 31
## JM Yes 72
## JP Yes 15
## JO Yes 63
## KZ Yes 75
## KE Yes 74
## KW Yes 55
## LV Yes 63
## LB No 53
## LS Yes 136
## LR Yes 77
## LY Yes 85
## LT Yes 59
## LU Yes 61
## MG Yes 81
## MW Yes 94
## MY Yes 25
## ML Yes 86
## MR Yes 75
## MU Yes 80
## MX Yes 60
## MD Yes 68
## MN Yes 70
## ME Yes 78
## MA Yes 63
## MZ Yes 83
## MM Yes 84
## NM Yes 75
## NP Yes 25
## NL No 59
## NZ Yes 59
## NI Yes 79
## NE Yes 81
## NO Yes 58
## OM Yes 56
## PK Yes 58
## PA Yes 70
## PY Yes 68
## PE Yes 67
## PH Yes 30
## PL Yes 64
## PT Yes 63
## QA Yes 61
## RO Yes 58
## RW Yes 75
## VC Yes 73
## SA Yes 63
## SN Yes 63
## RS Yes 67
## SL Yes 92
## SG Yes 24
## SK Yes 67
## SI Yes 65
## ZA Yes 66
## KR Yes 20
## ES Yes 32
## LK Yes 28
## SE No 32
## CH Yes 57
## TJ Yes 122
## TH Yes 13
## TG Yes 67
## TN Yes 63
## TR Yes 72
## UG Yes 82
## UA Yes 64
## AE Yes 27
## UK Yes 31
## US No 21
## UY Yes 75
## UZ Yes 76
## YE Yes 101
## ZM Yes 79
## ZW Yes 81
attach(covid)
Una vez que cargamos el archivo podemos comenzar a explorar los datos.
glimpse(covid)
## Rows: 139
## Columns: 35
## $ geoId <chr> "AF", "AL", "DZ", "AO", "AR", "AM", "AU", "AT", "AZ"…
## $ CntrName <chr> "Afghanistan", "Albania", "Algeria", "Angola", "Arge…
## $ muertes <int> 227, 33, 623, 4, 500, 98, 103, 645, 54, 544, 214, 93…
## $ casos <int> 12456, 1050, 8857, 71, 13920, 7774, 7139, 16515, 456…
## $ muertes.permil <dbl> 6.10668360, 11.51279525, 14.75309441, 0.12982898, 11…
## $ casos.permil <dbl> 335.087449, 366.316213, 209.740220, 2.304464, 312.84…
## $ l10muertes.permil <dbl> 0.85166698, 1.09735434, 1.19736588, 0.05301271, 1.08…
## $ Hombres80 <dbl> 0.2333258, 2.4480787, 1.1817555, 0.2075326, 1.774818…
## $ Mujeres80 <dbl> 0.3209823, 3.0339539, 1.3602137, 0.3372488, 3.447532…
## $ Pobla80 <dbl> 0.2771541, 2.7410163, 1.2709846, 0.2723907, 2.611175…
## $ Pobla65 <dbl> 2.584927, 13.744736, 6.362497, 2.216374, 11.117789, …
## $ PoblaMid <dbl> 54.32490, 68.58239, 63.48882, 50.97470, 64.12128, 68…
## $ PoblaData <dbl> 0.37172386, 0.02866376, 0.42228429, 0.30809762, 0.44…
## $ PoblaDens <dbl> 0.56937760, 1.04612263, 0.17730075, 0.24713052, 0.16…
## $ Mujeres <dbl> 48.63585, 49.06309, 49.48427, 50.53046, 51.23735, 52…
## $ Urbano <dbl> 25.495, 60.319, 72.629, 65.514, 91.870, 63.149, 86.0…
## $ ExpectVida <dbl> 62.701, 76.601, 75.307, 57.677, 72.924, 71.115, 80.4…
## $ NeontlMort <dbl> 37.1, 6.5, 14.6, 28.5, 6.4, 6.5, 2.3, 2.1, 11.2, 17.…
## $ DisMort <dbl> 29.8, 17.0, 14.2, 16.5, 15.8, 22.3, 9.1, 11.4, 22.2,…
## $ Lesion <dbl> 19.5, 4.0, 9.5, 9.2, 6.5, 3.9, 5.9, 5.2, 4.6, 7.5, 7…
## $ EnfNoTrans <dbl> 44.1, 93.1, 75.7, 27.4, 77.6, 93.3, 89.5, 92.2, 86.6…
## $ EnfTrans <dbl> 36.4, 2.9, 14.8, 63.4, 15.9, 2.8, 4.6, 2.6, 8.8, 25.…
## $ PBI <dbl> 1.8351696, 11.3351950, 14.1967389, 6.7205961, 20.068…
## $ Tuberculosis <dbl> 189.0, 18.0, 69.0, 355.0, 27.0, 31.0, 6.6, 7.1, 63.0…
## $ Diabetes <dbl> 9.2, 9.0, 6.7, 4.5, 5.9, 6.1, 5.6, 6.6, 6.1, 9.2, 5.…
## $ Medicos <dbl> 0.24009091, 1.21237143, 1.31202500, 0.17300000, 3.57…
## $ Camas <dbl> 0.4363636, 2.9375000, 1.9000000, 0.8000000, 4.600000…
## $ ImmunSaramp <int> 64, 94, 80, 50, 94, 95, 95, 94, 96, 97, 97, 96, 97, …
## $ TempMarzo <dbl> 7.60, 6.04, 17.91, 22.78, 17.51, -0.57, 25.37, 1.42,…
## $ HipTen.H <dbl> 18.6, 41.6, 22.3, 31.1, 41.8, 41.2, 34.8, 44.9, 25.9…
## $ HipTen.M <dbl> 19.8, 39.4, 23.0, 25.2, 32.9, 43.4, 32.8, 38.8, 31.4…
## $ HipTen <dbl> 19.20, 40.50, 22.65, 28.15, 37.35, 42.30, 33.80, 41.…
## $ BCG <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1…
## $ BCGf <chr> "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Yes", "Ye…
## $ Tiempo <int> 56, 69, 57, 82, 64, 61, 25, 57, 60, 69, 59, 35, 84, …
Con esto podemos ver que tenemos 31 variables numericas (dbl) y el resto con caracteres.
Vamos a utilizar describe(), que para las variables
numericas nos muestra los estadísticos descriptivos, la cantidad de
observaciones, los valores perdidos. Para las variables categóricas,
muestra la frecuencia, las proporciones y los valores perdidos.
describe(covid)
## vars n mean sd median trimmed mad min
## geoId* 1 139 70.00 40.27 70.00 70.00 51.89 1.00
## CntrName* 2 139 70.00 40.27 70.00 70.00 51.89 1.00
## muertes 3 139 2518.09 10218.47 66.00 411.64 96.37 0.00
## casos 4 139 37620.98 153435.34 3333.00 11417.52 4879.24 2.00
## muertes.permil 5 139 52.74 126.11 6.07 19.87 8.79 0.00
## casos.permil 6 139 1133.63 2050.18 277.58 715.48 369.85 0.95
## l10muertes.permil 7 139 1.03 0.76 0.85 0.97 0.83 0.00
## Hombres80 8 139 1.60 1.46 1.08 1.40 1.22 0.09
## Mujeres80 9 139 2.64 2.56 1.44 2.29 1.58 0.16
## Pobla80 10 139 2.12 2.00 1.27 1.86 1.40 0.13
## Pobla65 11 139 9.22 6.65 6.45 8.63 5.59 1.09
## PoblaMid 12 139 63.58 6.34 64.70 63.68 4.39 47.42
## PoblaData 13 139 0.49 1.68 0.11 0.19 0.12 0.00
## PoblaDens 14 139 1.88 6.84 0.81 1.02 0.83 0.02
## Mujeres 15 139 49.89 3.53 50.40 50.39 0.98 24.50
## Urbano 16 139 60.83 21.89 62.45 61.62 24.80 13.03
## ExpectVida 17 139 70.06 7.48 71.11 70.45 7.98 49.84
## NeontlMort 18 139 12.30 10.61 8.70 11.04 9.49 0.90
## DisMort 19 139 18.30 5.60 17.90 18.18 6.08 7.80
## Lesion 20 139 8.83 4.33 8.70 8.35 4.00 2.60
## EnfNoTrans 21 139 69.39 22.14 74.80 71.22 21.94 26.00
## EnfTrans 22 139 21.78 20.44 11.20 19.50 11.27 1.30
## PBI 23 139 20.09 21.58 12.35 16.42 14.24 0.76
## Tuberculosis 24 139 106.47 139.78 45.00 77.53 56.34 1.00
## Diabetes 25 139 7.43 3.77 6.50 7.04 2.97 1.00
## Medicos 26 139 1.65 1.42 1.38 1.54 1.74 0.02
## Camas 27 139 2.98 2.47 2.17 2.65 1.85 0.20
## ImmunSaramp 28 139 88.21 13.22 93.00 90.77 7.41 30.00
## TempMarzo 29 139 15.38 11.10 19.99 16.15 10.23 -18.72
## HipTen.H 30 139 32.80 9.25 32.60 32.96 10.53 9.00
## HipTen.M 31 139 31.98 7.85 32.00 31.93 9.19 12.40
## HipTen 32 139 32.39 8.33 32.00 32.50 9.27 10.70
## BCG 33 139 0.95 0.22 1.00 1.00 0.00 0.00
## BCGf* 34 139 1.95 0.22 2.00 2.00 0.00 1.00
## Tiempo 35 139 63.15 21.33 65.00 63.98 13.34 0.00
## max range skew kurtosis se
## geoId* 139.00 138.00 0.00 -1.23 3.42
## CntrName* 139.00 138.00 0.00 -1.23 3.42
## muertes 100442.00 100442.00 7.11 59.97 866.72
## casos 1699933.00 1699931.00 9.32 96.46 13014.22
## muertes.permil 819.82 819.82 3.64 14.29 10.70
## casos.permil 17596.22 17595.27 4.33 28.30 173.89
## l10muertes.permil 2.91 2.91 0.55 -0.51 0.06
## Hombres80 6.17 6.08 1.05 0.27 0.12
## Mujeres80 10.56 10.39 1.00 -0.20 0.22
## Pobla80 8.36 8.23 0.99 -0.12 0.17
## Pobla65 27.58 26.49 0.69 -0.90 0.56
## PoblaMid 85.09 37.67 0.00 0.89 0.54
## PoblaData 13.93 13.93 7.12 52.89 0.14
## PoblaDens 79.53 79.51 10.57 116.79 0.58
## Mujeres 54.54 30.04 -4.69 26.42 0.30
## Urbano 100.00 86.97 -0.29 -0.84 1.86
## ExpectVida 81.70 31.86 -0.48 -0.49 0.63
## NeontlMort 42.00 41.10 0.86 -0.38 0.90
## DisMort 30.60 22.80 0.14 -0.68 0.47
## Lesion 28.40 25.80 1.43 3.49 0.37
## EnfNoTrans 95.20 69.20 -0.68 -1.02 1.88
## EnfTrans 65.30 64.00 0.89 -0.78 1.73
## PBI 123.21 122.46 1.89 4.36 1.83
## Tuberculosis 611.00 610.00 1.86 2.86 11.86
## Diabetes 22.00 21.00 1.20 1.74 0.32
## Medicos 5.71 5.69 0.53 -0.87 0.12
## Camas 13.80 13.60 1.47 2.51 0.21
## ImmunSaramp 99.00 69.00 -2.00 4.13 1.12
## TempMarzo 30.63 49.35 -0.55 -0.89 0.94
## HipTen.H 54.60 45.60 -0.09 -0.73 0.78
## HipTen.M 50.60 38.20 0.05 -0.53 0.67
## HipTen 50.60 39.90 -0.06 -0.65 0.71
## BCG 1.00 1.00 -4.07 14.65 0.02
## BCGf* 2.00 1.00 -4.07 14.65 0.02
## Tiempo 136.00 136.00 -0.23 1.25 1.81
summary = summary(covid)
summary
## geoId CntrName muertes casos
## Length:139 Length:139 Min. : 0 Min. : 2.0
## Class :character Class :character 1st Qu.: 12 1st Qu.: 725.5
## Mode :character Mode :character Median : 66 Median : 3333.0
## Mean : 2518 Mean : 37621.0
## 3rd Qu.: 548 3rd Qu.: 20625.0
## Max. :100442 Max. :1699933.0
## muertes.permil casos.permil l10muertes.permil Hombres80
## Min. : 0.000 Min. : 0.949 Min. :0.0000 Min. :0.08737
## 1st Qu.: 2.214 1st Qu.: 70.054 1st Qu.:0.5062 1st Qu.:0.37722
## Median : 6.074 Median : 277.583 Median :0.8497 Median :1.07801
## Mean : 52.735 Mean : 1133.633 Mean :1.0282 Mean :1.59580
## 3rd Qu.: 33.787 3rd Qu.: 1596.139 3rd Qu.:1.5414 3rd Qu.:2.57442
## Max. :819.817 Max. :17596.220 Max. :2.9142 Max. :6.16625
## Mujeres80 Pobla80 Pobla65 PoblaMid
## Min. : 0.1639 Min. :0.1308 Min. : 1.085 Min. :47.42
## 1st Qu.: 0.5983 1st Qu.:0.4885 1st Qu.: 3.284 1st Qu.:60.15
## Median : 1.4421 Median :1.2710 Median : 6.450 Median :64.70
## Mean : 2.6441 Mean :2.1200 Mean : 9.223 Mean :63.58
## 3rd Qu.: 4.5155 3rd Qu.:3.7069 3rd Qu.:14.920 3rd Qu.:66.90
## Max. :10.5564 Max. :8.3613 Max. :27.576 Max. :85.09
## PoblaData PoblaDens Mujeres Urbano
## Min. : 0.001102 Min. : 0.02041 Min. :24.50 Min. : 13.03
## 1st Qu.: 0.047427 1st Qu.: 0.33375 1st Qu.:49.72 1st Qu.: 44.62
## Median : 0.111232 Median : 0.80729 Median :50.40 Median : 62.45
## Mean : 0.485381 Mean : 1.87767 Mean :49.89 Mean : 60.83
## 3rd Qu.: 0.333277 3rd Qu.: 1.46399 3rd Qu.:51.01 3rd Qu.: 78.83
## Max. :13.927300 Max. :79.52998 Max. :54.54 Max. :100.00
## ExpectVida NeontlMort DisMort Lesion
## Min. :49.84 Min. : 0.90 Min. : 7.80 Min. : 2.600
## 1st Qu.:64.57 1st Qu.: 3.40 1st Qu.:14.30 1st Qu.: 5.650
## Median :71.11 Median : 8.70 Median :17.90 Median : 8.700
## Mean :70.06 Mean :12.30 Mean :18.30 Mean : 8.827
## 3rd Qu.:75.14 3rd Qu.:20.45 3rd Qu.:22.35 3rd Qu.:10.700
## Max. :81.70 Max. :42.00 Max. :30.60 Max. :28.400
## EnfNoTrans EnfTrans PBI Tuberculosis
## Min. :26.00 Min. : 1.30 Min. : 0.7568 Min. : 1.0
## 1st Qu.:48.50 1st Qu.: 5.20 1st Qu.: 4.1778 1st Qu.: 13.0
## Median :74.80 Median :11.20 Median : 12.3515 Median : 45.0
## Mean :69.39 Mean :21.78 Mean : 20.0941 Mean :106.5
## 3rd Qu.:88.75 3rd Qu.:38.00 3rd Qu.: 28.3214 3rd Qu.:150.0
## Max. :95.20 Max. :65.30 Max. :123.2139 Max. :611.0
## Diabetes Medicos Camas ImmunSaramp
## Min. : 1.000 Min. :0.01767 Min. : 0.200 Min. :30.00
## 1st Qu.: 5.050 1st Qu.:0.28709 1st Qu.: 1.147 1st Qu.:85.00
## Median : 6.500 Median :1.38303 Median : 2.171 Median :93.00
## Mean : 7.425 Mean :1.65391 Mean : 2.980 Mean :88.21
## 3rd Qu.: 9.200 3rd Qu.:2.77551 3rd Qu.: 3.984 3rd Qu.:97.00
## Max. :22.000 Max. :5.71011 Max. :13.796 Max. :99.00
## TempMarzo HipTen.H HipTen.M HipTen
## Min. :-18.72 Min. : 9.00 Min. :12.40 Min. :10.70
## 1st Qu.: 4.93 1st Qu.:25.85 1st Qu.:25.85 1st Qu.:26.07
## Median : 19.99 Median :32.60 Median :32.00 Median :32.00
## Mean : 15.38 Mean :32.80 Mean :31.98 Mean :32.39
## 3rd Qu.: 25.25 3rd Qu.:40.40 3rd Qu.:38.00 3rd Qu.:39.83
## Max. : 30.63 Max. :54.60 Max. :50.60 Max. :50.60
## BCG BCGf Tiempo
## Min. :0.0000 Length:139 Min. : 0.00
## 1st Qu.:1.0000 Class :character 1st Qu.: 57.00
## Median :1.0000 Mode :character Median : 65.00
## Mean :0.9496 Mean : 63.15
## 3rd Qu.:1.0000 3rd Qu.: 75.00
## Max. :1.0000 Max. :136.00
Conociendo que significa cada variable, entendiendo del tipo que son y consoderando que buscamos construir el mejor modelo de regresión que nos permita explicar las muertes debido a causa del COVID-19, podríamos categorizar las mismas en los siguientes grupos:
Demográficas: son todas las variables
relacionadas a la temática poblacional. Incluimos en esta:
Hombres80, Mujeres80, Pobla80,
Pobla65, PoblaMid, PoblaData,
PoblaDens, Mujeres,
Urbano
Salud: consideramos las features que hablan
sobre enfermedades o topicos de salud
ExpectVida, NeontlMort, DisMort, Lesion, EnfNoTrans,Tuberculosis,Diabetes, ImmunSaramp, HipTen.H, HipTen.M, BCG, BCGf
Sistema de salud: son las variables relacionadas
al tipo de sistema de salud, podríamos considerarlo dentro de salud
también Medicos,Camas
Económicas: factores del tipo económico
PBI
Ambientales: consideramos temas de ambiente como
la tempratura o el clima TempMarzo
Geolocalizacion
geoid, CntrName
Covid muertes
l10muertes.permil, muertes.permil
Considerando que el covid es una enfermedad del tipo respiratoria, altamente contagiosa, que se transmite por aire, afecta con mayor severidad a aquellas personas que tienen una edad superior a 65 años y que si el paciente presenta una patología previa como diabetes, problemas cardíacos, respiratorios u obesidad puede necesitar tratemiento en hospitales. Es interesante estudiar lo siguiente:
¿Los paises de mayor densidad poblacional tienen un porcentaje alto de población mayor a 65 años?.
Entender que porcentaje de la población presenta una patología previa, con los datos que tenemos es complejo delimitar este valor y sacar un promedio no sería correcto, por lo que decidimos observar la relación por separado de patología como diabetes e hipertension con las muertes
Clasificar a los países por nivel economico utilizando el PBI, que en este caso representa el PBI per capita, y entender si hay alguna relacion con las muertes, si aquellos países con menor poder económico presentan mayor cantidad
Ver la relacion entre las camas de hospital y la población de 65 años
Considerar la relacion de medicos y camas de hospitales
Países muertes vs poblacion 65
ggplot(covid, aes(x = muertes.permil, y = Pobla65, color = Pobla65)) +
geom_point()
ggplot(covid, aes(x = muertes.permil, y = PoblaMid, color = PoblaMid)) +
geom_point()
Menor porcentaje de poblacion mayor a 65 años corresponden menor muertes por mil, mientras que a mayores porcentajes tenemos algunos casos con más muertes. Si lo comparamos vs el grafico que muestra las muertes permil y el porcentaje de población entre 15 y 64 años se puede ver una diferencia en que la mayoría de los puntos estan concentrados en forma vertical cerca del 0 y 50
Países mayor densidad vs poblacion 65
ggplot(covid, aes(x = Pobla65, y = PoblaDens, color = PoblaDens)) +
geom_point()
Como tenemos un valor fuera del rango no podemos concluir nada.
Muertes vs patologías
ggplot(covid, aes(x = muertes.permil, y = Diabetes,
colour = Diabetes)) +
geom_point(show.legend = FALSE) +
scale_color_gradient(low = "#67c9ff", high = "#f2bbfc")
ggplot(covid, aes(x = muertes.permil, y = HipTen.H,
colour = HipTen.H)) +
geom_point(show.legend = FALSE) +
scale_color_gradient(low = "#67c9ff", high = "#f2bbfc")
ggplot(covid, aes(x = muertes.permil, y = HipTen.M,
colour = HipTen.M)) +
geom_point(show.legend = FALSE) +
scale_color_gradient(low = "#67c9ff", high = "#f2bbfc")
ggplot(covid, aes(x = muertes.permil, y = BCG,
colour = BCG)) +
geom_point(show.legend = FALSE) +
scale_color_gradient(low = "#67c9ff", high = "#f2bbfc")
No se puede ver que las patologías previas o la inmunización tengan alguna relación directa con las muertes, si se puede ver que en algunos casos para la diabetes e hipertension en poblaciones con porcentajes medios o elevados hay mayor cantidad de muertes. Puede ser que para ese entonces no se haya considerado mucho este factor porque hoy en día se saben que implican mayor riesgo
PBI vs muertes
El producto bruto interno es un indicador economico que tiene en cuenta diversos factores. Si a este lo dividimos por la población del país obtenemos el PBI per capita, o PPP, valor que representa esta variable. Podríamos asumir que aquellos países que tengan un PBI per capita bajo o medio enfrentararn mayor dificultades para implememtar una política de inumización dado que les costará más comprar vacuanas o también debido a que es probable que la gran mayoría de su población esten en condiciones económicas severas no puedan realizar aislamientos, no tengan la educación ni los recursos para intentar no contagiarse de covid, lo que puede llevar a mayor cantidad de casos en países con sistemas de salud escasos provocando mayor cantidad de muertes.
Vamos a generar este indicador y clasificaremos a los países en 4 categorías.
- Ingreso Bajo PBI per capita <1.036
- Ingreso medio Bajo PBI per capita 1.036 - 4.045
- Ingreso medio Alto PBI per capita 4.046 - 12.535
- Ingreso Alto PBI per capita >12.535
ggplot(covid, aes(x = muertes.permil, y = PBI)) +
geom_point(aes(colour = PBI > 4.045 & PBI < 12.535),
show.legend = FALSE) +
geom_hline(yintercept = 4.045, linetype = "dashed") +
geom_hline(yintercept = 12.535, linetype = "dashed")+
xlim(0, 50)+
ylim(0,60)
## Warning: Removed 34 rows containing missing values (geom_point).
No pareciera que aquellos países con PBI per capita menor tuvieran mayor cantidad de muertes.
Poblacion 65 vs Camas de hospitales
ggplot(covid, aes(x = Pobla65, y = Camas, color = Camas)) +
geom_point()
Camas vs Medicos
ggplot(covid, aes(x = Camas, y = Medicos,
colour = Medicos)) +
geom_point(show.legend = FALSE) +
scale_color_gradient(low = "#67c9ff", high = "#f2bbfc")
Dado que tenemos varias variables en nuestro dataset para realizar un análisis gráfico representativo seleccionaremos algunas de estas variables para observar su comportamiento.
covid_datos_1 = data.frame(PoblaDens, Pobla80,Urbano, l10muertes.permil)
covid_datos_2 = data.frame(Tuberculosis,Camas, TempMarzo,l10muertes.permil)
covid_datos_3 = data.frame(l10muertes.permil, PBI,muertes.permil,BCG)
covid_datos_1
## PoblaDens Pobla80 Urbano l10muertes.permil
## 1 0.56937760 0.2771541 25.495 0.85166698
## 2 1.04612263 2.7410163 60.319 1.09735434
## 3 0.17730075 1.2709846 72.629 1.19736588
## 4 0.24713052 0.2723907 65.514 0.05301271
## 5 0.16258510 2.6111754 91.870 1.08768715
## 6 1.03680225 3.1239347 63.149 1.53403057
## 7 0.03249129 4.0436339 86.012 0.70937665
## 8 1.07206927 5.2369767 58.297 1.86867832
## 9 1.20265320 1.3597424 55.680 0.80830014
## 10 12.39579312 0.9964088 36.632 0.64062316
## 11 0.46728800 3.8045048 78.595 1.37219412
## 12 3.77214927 5.6948380 98.001 2.91424609
## 13 0.16793994 1.0395255 45.724 0.79385771
## 14 1.01853920 0.4365651 47.312 0.10078712
## 15 0.19777528 1.2095158 40.895 0.00000000
## 16 0.10480146 1.6248620 69.425 1.40930364
## 17 0.64920488 3.3861895 48.245 1.66678153
## 18 0.03977425 0.4939442 69.446 0.15945618
## 19 0.25061716 1.8060280 86.569 2.09062497
## 20 0.81396964 0.7583938 77.629 0.75300190
## 21 0.64703537 4.7222857 75.008 1.29960529
## 22 0.72191283 0.2453268 29.358 0.56624131
## 23 4.35178271 0.2917947 13.032 0.03722023
## 24 0.92056413 0.5703887 23.388 0.00000000
## 25 0.53343989 0.3083562 56.374 0.90413575
## 26 0.04075308 4.3071336 81.411 2.26374838
## 27 0.07490412 0.3528256 41.364 0.08432564
## 28 0.44748702 1.7597254 80.778 1.23486238
## 29 4.47244478 0.3889863 28.965 0.53185125
## 30 0.15356846 0.2877278 66.916 0.66491803
## 31 0.73077198 5.5638202 56.947 1.40989932
## 32 1.37602888 4.0918014 73.792 1.48902061
## 33 1.38067302 4.5174188 87.874 1.99324531
## 34 0.41368421 0.6099089 77.777 1.29603122
## 35 2.19978576 1.5873319 81.074 1.65899033
## 36 0.68788682 1.5376442 63.821 2.28487232
## 37 0.98873469 0.7910340 42.704 0.96804820
## 38 3.09881467 1.8419292 72.023 0.84966889
## 39 0.46665740 0.2886712 72.143 1.00721356
## 40 0.30386105 5.5491132 68.880 1.70728513
## 41 1.09224559 0.5012502 20.763 0.02322475
## 42 0.48357033 0.5795601 56.248 0.00000000
## 43 0.18156856 5.4057724 85.382 1.76134842
## 44 1.22338396 6.1032258 80.444 2.63132934
## 45 0.08224764 0.5335561 89.370 0.88115819
## 46 2.25306522 0.2595557 61.270 0.15793307
## 47 0.65275202 3.6827447 58.632 0.62493108
## 48 2.37370970 6.6270801 77.312 2.01040779
## 49 1.30821429 0.3266130 56.060 0.33086008
## 50 0.83224732 7.2679122 79.058 1.23366924
## 51 1.60953779 1.0548473 51.054 0.69394933
## 52 0.50522212 0.3195615 36.140 0.43000974
## 53 0.03957348 1.2722362 26.606 1.17956888
## 54 4.03598549 0.8276328 55.278 0.60817085
## 55 0.85687032 1.0293956 57.096 1.32704478
## 56 1.07906606 4.2713096 71.351 1.72513328
## 57 0.12291734 0.3130915 23.059 0.71053771
## 58 0.25189446 2.7008155 87.564 1.66184336
## 59 1.48348833 1.7877871 59.152 0.63650295
## 60 4.54938073 0.9448065 34.030 0.63846947
## 61 1.47752190 0.8561815 55.325 0.81312576
## 62 0.50222420 1.1233084 74.898 1.97066822
## 63 0.88530570 0.4831038 70.473 0.74455172
## 64 0.70452983 3.0188525 63.170 2.52768884
## 65 4.10526802 3.0461867 92.418 1.51362517
## 66 2.05450748 7.1734357 70.438 2.73899149
## 67 2.70993075 2.0456797 55.674 0.60923050
## 68 3.47073458 8.3613475 91.616 0.89103814
## 69 1.12142498 0.6023762 90.979 0.27966158
## 70 0.06769826 1.4932044 57.428 0.48064752
## 71 0.90299417 0.2699139 27.030 0.31600904
## 72 2.32172222 0.2327419 100.000 1.63646809
## 73 0.30983307 5.5652960 68.142 1.11188355
## 74 6.69494135 1.4828557 88.593 0.68089875
## 75 0.69437813 0.8209008 28.153 0.00000000
## 76 0.50030907 0.3996440 51.151 0.81973136
## 77 0.03795632 0.7605248 80.102 0.20382969
## 78 0.44531351 5.8370281 67.679 1.39199086
## 79 2.50093827 4.0235270 90.981 2.26007623
## 80 0.45139856 0.4241700 37.191 0.03187466
## 81 1.92440762 0.3087382 16.937 0.08652600
## 82 0.95962821 1.0741699 76.036 0.66721788
## 83 0.15635016 0.2683715 42.356 0.66924316
## 84 0.04272164 0.4204185 53.672 0.66592067
## 85 6.23301970 2.0227961 40.793 0.94954834
## 86 0.64914626 1.5523039 80.156 1.83964772
## 87 1.23519804 2.2672524 42.629 1.89361039
## 88 0.02040609 0.6283914 68.445 0.00000000
## 89 0.46271004 3.4204855 66.813 1.18924972
## 90 0.80728519 1.1687236 62.453 0.81997625
## 91 0.37508535 0.3481273 35.988 0.01447977
## 92 0.82238615 0.7791075 30.579 0.04599322
## 93 0.02973746 0.6151794 50.032 0.00000000
## 94 1.95939107 0.7516195 19.740 0.05782208
## 95 5.11457910 4.6976392 91.490 2.53367393
## 96 0.18554176 3.7311137 86.538 0.74060910
## 97 0.53727048 1.1025688 58.522 0.80708405
## 98 0.17717651 0.2340882 16.425 0.58564967
## 99 0.14554920 4.2231531 82.248 1.65533067
## 100 0.15604145 0.4596337 84.539 0.94784219
## 101 2.75289319 0.6545620 36.666 0.84119511
## 102 0.56186077 1.9205337 67.709 1.88318015
## 103 0.17508359 1.2135437 61.585 0.41184731
## 104 0.24991606 1.6809015 77.907 2.09868025
## 105 3.57688305 0.7893793 46.907 0.97663292
## 106 1.24035886 4.4631164 60.058 1.44821011
## 107 1.12239454 6.3408699 65.211 2.12347272
## 108 2.39593196 0.1847213 99.135 1.07132447
## 109 0.84639847 4.7084438 53.998 1.80343313
## 110 4.98659870 0.3624706 17.211 0.00000000
## 111 2.82589744 2.4482249 52.198 0.00000000
## 112 0.15676654 0.5038453 83.844 1.13389947
## 113 0.82347478 0.3825330 47.192 0.53906244
## 114 0.79831740 4.0191136 56.092 1.54868038
## 115 1.05987171 0.3522140 42.055 0.83772947
## 116 79.52998418 2.1766595 100.000 0.70577580
## 117 1.13290578 3.2223629 53.726 0.78819906
## 118 1.02639860 5.3152643 54.541 1.72227622
## 119 0.47630120 0.7184723 66.355 1.02339821
## 120 5.29652104 3.2120425 81.459 0.79306494
## 121 0.93529058 6.1672057 80.321 2.76446761
## 122 3.45558922 1.6065781 18.476 0.16478915
## 123 0.25001043 5.1726032 87.431 2.61847597
## 124 2.15521378 5.1493834 73.797 2.28867018
## 125 0.65572714 0.5234433 27.134 0.78207686
## 126 1.35897207 2.5315654 49.949 0.26030714
## 127 1.45046773 0.2700138 41.702 0.42289247
## 128 0.74441323 1.7197442 68.945 0.71183934
## 129 1.06960129 1.6774797 75.143 1.73570816
## 130 2.13061734 0.2057545 23.774 0.00000000
## 131 0.77029667 3.9876216 69.352 1.18842716
## 132 1.35609110 0.1307769 86.522 1.43897112
## 133 2.74827392 5.0282090 83.398 2.75158819
## 134 0.35766089 3.8751036 82.256 2.48855760
## 135 0.19708028 4.3947641 95.334 0.86794498
## 136 0.77469205 0.8369038 50.478 0.15375896
## 137 0.53977853 0.3498816 36.642 0.45632576
## 138 0.23341479 0.2529708 43.521 0.14718638
## 139 0.37324591 0.4222739 32.209 0.10620013
covid_datos_2
## Tuberculosis Camas TempMarzo l10muertes.permil
## 1 189.0 0.4363636 7.60 0.85166698
## 2 18.0 2.9375000 6.04 1.09735434
## 3 69.0 1.9000000 17.91 1.19736588
## 4 355.0 0.8000000 22.78 0.05301271
## 5 27.0 4.6000000 17.51 1.08768715
## 6 31.0 4.0200000 -0.57 1.53403057
## 7 6.6 3.8783333 25.37 0.70937665
## 8 7.1 7.7000000 1.42 1.86867832
## 9 63.0 6.4666667 4.97 0.80830014
## 10 221.0 0.5750000 25.42 0.64062316
## 11 31.0 11.2000000 -0.69 1.37219412
## 12 9.0 6.5500000 5.23 2.91424609
## 13 30.0 1.1600000 24.45 0.79385771
## 14 56.0 0.5000000 30.14 0.10078712
## 15 149.0 1.7333333 5.68 0.00000000
## 16 108.0 1.1000000 22.07 1.40930364
## 17 25.0 3.3666667 4.01 1.66678153
## 18 275.0 2.0000000 24.30 0.15945618
## 19 45.0 2.3285714 25.49 2.09062497
## 20 68.0 2.7542857 25.92 0.75300190
## 21 22.0 6.4888889 4.70 1.29960529
## 22 48.0 0.6500000 30.63 0.56624131
## 23 111.0 1.1333333 20.43 0.03722023
## 24 302.0 0.7600000 27.93 0.00000000
## 25 186.0 1.4000000 26.27 0.90413575
## 26 5.6 3.0714286 -18.72 2.26374838
## 27 540.0 1.1000000 26.96 0.08432564
## 28 33.0 1.3166667 25.14 1.23486238
## 29 35.0 2.2000000 25.20 0.53185125
## 30 375.0 1.6000000 25.60 0.66491803
## 31 8.4 5.6354545 5.83 1.40989932
## 32 5.4 7.0100000 2.80 1.48902061
## 33 5.4 3.4111111 2.24 1.99324531
## 34 260.0 1.4571429 25.75 1.29603122
## 35 45.0 1.4375000 22.88 1.65899033
## 36 44.0 1.5285714 21.93 2.28487232
## 37 12.0 1.5100000 17.83 0.96804820
## 38 70.0 0.9900000 25.70 0.84966889
## 39 201.0 2.0666667 25.04 1.00721356
## 40 13.0 5.3600000 -2.35 1.70728513
## 41 151.0 1.7500000 23.48 0.02322475
## 42 54.0 2.1475000 25.00 0.00000000
## 43 4.7 5.9600000 -6.09 1.76134842
## 44 8.9 6.9222222 6.37 2.63132934
## 45 525.0 3.2000000 26.14 0.88115819
## 46 174.0 1.0000000 27.32 0.15793307
## 47 80.0 3.1222222 0.72 0.62493108
## 48 7.3 8.2555556 3.87 2.01040779
## 49 148.0 0.9000000 29.52 0.33086008
## 50 4.5 4.6555556 8.19 1.23366924
## 51 26.0 0.6250000 22.94 0.69394933
## 52 176.0 0.3000000 27.63 0.43000974
## 53 83.0 2.1600000 25.65 1.17956888
## 54 176.0 1.0000000 23.47 0.60817085
## 55 37.0 0.7285714 23.38 1.32704478
## 56 6.4 7.3000000 5.44 1.72513328
## 57 142.0 0.4000000 26.55 0.71053771
## 58 18.0 2.1714286 10.87 1.66184336
## 59 61.0 3.4066667 0.49 0.63650295
## 60 199.0 0.8000000 23.45 0.63846947
## 61 316.0 0.9000000 25.79 0.81312576
## 62 14.0 1.4400000 11.33 1.97066822
## 63 42.0 1.3100000 15.12 0.74455172
## 64 7.0 3.9555556 6.00 2.52768884
## 65 4.0 3.5333333 14.96 1.51362517
## 66 7.0 3.6875000 6.52 2.73899149
## 67 2.9 1.7571429 23.44 0.60923050
## 68 14.0 13.7960000 2.52 0.89103814
## 69 5.0 1.7818182 13.08 0.27966158
## 70 68.0 7.4111111 -3.96 0.48064752
## 71 292.0 1.4000000 26.10 0.31600904
## 72 23.0 1.9800000 19.23 1.63646809
## 73 29.0 6.8111111 -1.37 1.11188355
## 74 11.0 3.3800000 10.39 0.68089875
## 75 611.0 1.3000000 15.13 0.00000000
## 76 308.0 0.7500000 26.44 0.81973136
## 77 40.0 3.6700000 17.76 0.20382969
## 78 44.0 7.1666667 -0.47 1.39199086
## 79 8.0 5.3727273 4.70 2.26007623
## 80 233.0 0.2500000 23.99 0.03187466
## 81 181.0 1.2000000 23.25 0.08652600
## 82 92.0 1.8312500 25.19 0.66721788
## 83 53.0 0.3333333 27.34 0.66924316
## 84 93.0 0.4000000 25.29 0.66592067
## 85 13.0 3.2333333 25.48 0.94954834
## 86 23.0 1.5888889 18.44 1.83964772
## 87 86.0 6.1666667 2.93 1.89361039
## 88 428.0 6.3266667 -8.80 0.00000000
## 89 15.0 4.0125000 2.53 1.18924972
## 90 99.0 0.9800000 13.09 0.81997625
## 91 551.0 0.7666667 25.48 0.01447977
## 92 338.0 0.7500000 22.74 0.04599322
## 93 524.0 3.0000000 22.67 0.00000000
## 94 151.0 2.6500000 10.02 0.05782208
## 95 5.3 4.6000000 4.95 2.53367393
## 96 7.3 2.5500000 13.60 0.74060910
## 97 41.0 0.9222222 24.95 0.80708405
## 98 87.0 0.3000000 26.01 0.58564967
## 99 4.1 4.2555556 -5.49 1.65533067
## 100 5.9 1.8600000 23.40 0.94784219
## 101 265.0 0.7200000 16.01 0.84119511
## 102 52.0 2.2888889 25.44 1.88318015
## 103 43.0 1.2857143 25.84 0.41184731
## 104 123.0 1.4875000 19.99 2.09868025
## 105 554.0 0.5833333 25.13 0.97663292
## 106 16.0 6.5222222 2.65 1.44821011
## 107 24.0 3.4222222 11.33 2.12347272
## 108 31.0 1.6400000 21.78 1.07132447
## 109 68.0 6.4555556 3.40 1.80343313
## 110 59.0 1.6000000 19.25 0.00000000
## 111 6.3 3.3000000 25.90 0.00000000
## 112 10.0 2.2500000 20.60 1.13389947
## 113 118.0 0.2000000 28.47 0.53906244
## 114 17.0 5.6125000 4.91 1.54868038
## 115 298.0 0.4000000 27.65 0.83772947
## 116 47.0 2.7457143 28.62 0.70577580
## 117 5.8 6.3400000 2.40 0.78819906
## 118 5.3 4.6555556 3.38 1.72227622
## 119 520.0 2.8000000 21.10 1.02339821
## 120 66.0 10.6080000 3.66 0.79306494
## 121 9.4 3.1888889 8.60 2.76446761
## 122 64.0 3.5500000 27.03 0.16478915
## 123 5.5 2.7666667 -4.98 2.61847597
## 124 6.4 5.1222222 0.09 2.28867018
## 125 84.0 5.2666667 -3.08 0.78207686
## 126 153.0 2.1000000 27.38 0.26030714
## 127 36.0 0.8000000 29.31 0.42289247
## 128 35.0 2.0545455 14.21 0.71183934
## 129 16.0 2.4555556 4.77 1.73570816
## 130 200.0 0.7500000 23.68 0.00000000
## 131 80.0 8.9222222 1.18 1.18842716
## 132 1.0 1.6777778 22.61 1.43897112
## 133 8.0 3.2111111 4.66 2.75158819
## 134 3.0 3.0333333 0.06 2.48855760
## 135 33.0 2.5250000 21.26 0.86794498
## 136 70.0 4.5888889 5.38 0.15375896
## 137 48.0 0.6900000 20.82 0.45632576
## 138 346.0 1.9500000 22.90 0.14718638
## 139 210.0 2.3500000 22.92 0.10620013
covid_datos_3
## l10muertes.permil PBI muertes.permil BCG
## 1 0.85166698 1.8351696 6.10668360 1
## 2 1.09735434 11.3351950 11.51279525 1
## 3 1.19736588 14.1967389 14.75309441 1
## 4 0.05301271 6.7205961 0.12982898 1
## 5 1.08768715 20.0684923 11.23734344 1
## 6 1.53403057 8.3491802 33.20035125 1
## 7 0.70937665 45.7525548 4.12125797 1
## 8 1.86867832 48.9687140 72.90576495 1
## 9 0.80830014 17.0906963 5.43132025 1
## 10 0.64062316 3.3061083 3.37142634 1
## 11 1.37219412 18.1721809 22.56102177 1
## 12 2.91424609 45.2631622 819.81651659 0
## 13 0.79385771 8.0937796 5.22096426 1
## 14 0.10078712 2.0675705 0.26120918 1
## 15 0.00000000 8.3417246 0.00000000 1
## 16 1.40930364 6.5317860 24.66277617 1
## 17 1.66678153 11.6971771 45.42816649 1
## 18 0.15945618 16.1336867 0.44363092 1
## 19 2.09062497 15.5847506 122.20404597 1
## 20 0.75300190 80.8004129 4.66241765 1
## 21 1.29960529 17.9465777 18.93449746 1
## 22 0.56624131 1.6709928 2.68333575 1
## 23 0.03722023 0.7568378 0.08948243 1
## 24 0.00000000 3.3333517 0.00000000 1
## 25 0.90413575 3.2930885 7.01928682 1
## 26 2.26374838 44.2264907 182.54745910 0
## 27 0.08432564 0.8532664 0.21429902 1
## 28 1.23486238 13.2116325 16.17364085 1
## 29 0.53185125 2.6420144 2.40291618 1
## 30 0.66491803 5.6636489 3.62293762 1
## 31 1.40989932 22.9922117 24.69799971 1
## 32 1.48902061 32.7718057 29.83334267 1
## 33 1.99324531 48.5249925 97.45670766 1
## 34 1.29603122 2.7442687 18.77111751 1
## 35 1.65899033 13.9050879 44.60267625 1
## 36 2.28487232 10.8759023 191.69583028 1
## 37 0.96804820 10.8110341 8.29069493 1
## 38 0.84966889 7.2348467 6.07406245 1
## 39 1.00721356 30.5908474 9.16748537 1
## 40 1.70728513 28.8340001 49.96653756 1
## 41 0.02322475 1.5126247 0.05493270 1
## 42 0.00000000 8.8754441 0.00000000 1
## 43 1.76134842 42.8552430 56.72293654 1
## 44 2.63132934 40.3515680 426.88724438 1
## 45 0.88115819 17.0778163 6.60603272 1
## 46 0.15793307 2.4051919 0.43857687 1
## 47 0.62493108 9.5834608 3.21629590 1
## 48 2.01040779 46.5762068 101.42542822 1
## 49 0.33086008 3.9219764 1.14220031 1
## 50 1.23366924 27.2065489 16.12652442 1
## 51 0.69394933 7.5159291 3.94253020 1
## 52 0.43000974 2.0022876 1.69159514 1
## 53 1.17956888 7.1987245 14.12059502 1
## 54 0.60817085 1.7058976 3.05668093 1
## 55 1.32704478 4.4336960 20.23463414 1
## 56 1.72513328 25.7573736 52.10473974 1
## 57 0.71053771 2.0073216 4.13496767 1
## 58 1.66184336 22.2523960 44.90324179 1
## 59 0.63650295 13.5313781 3.33015014 1
## 60 0.63846947 5.8366566 3.34980183 1
## 61 0.81312576 10.5772045 5.50317977 1
## 62 1.97066822 18.4501839 92.46913357 1
## 63 0.74455172 15.8895142 4.55330752 1
## 64 2.52768884 59.3055780 336.04573683 1
## 65 1.51362517 34.5710854 31.63060852 1
## 66 2.73899149 37.7630816 547.26622303 0
## 67 0.60923050 8.5085469 3.06659102 1
## 68 0.89103814 39.1530060 6.78104879 1
## 69 0.27966158 9.2014965 0.90397650 1
## 70 0.48064752 24.1030338 2.02445775 1
## 71 0.31600904 2.8839337 1.07018445 1
## 72 1.63646809 75.8307296 42.29802512 1
## 73 1.11188355 23.8146826 11.93848875 1
## 74 0.68089875 13.2450688 3.79621619 0
## 75 0.00000000 2.9043623 0.00000000 1
## 76 0.81973136 1.2563111 5.60284890 1
## 77 0.20382969 19.3396159 0.59893088 1
## 78 1.39199086 27.8087523 23.65987425 1
## 79 2.26007623 100.2191161 181.00202722 1
## 80 0.03187466 1.7044431 0.07615460 1
## 81 0.08652600 1.1836484 0.22046688 1
## 82 0.66721788 25.8714034 3.64748370 1
## 83 0.66924316 2.0131236 3.66920733 1
## 84 0.66592067 3.8172107 3.63362273 1
## 85 0.94954834 19.3987280 7.90324531 1
## 86 1.83964772 17.8555895 68.12700147 1
## 87 1.89361039 5.8933274 77.27271317 1
## 88 0.00000000 11.1277975 0.00000000 1
## 89 1.18924972 16.2734892 14.46143216 1
## 90 0.81997625 7.4795258 5.60657321 1
## 91 0.01447977 1.2616857 0.03390295 1
## 92 0.04599322 5.0214146 0.11171438 1
## 93 0.00000000 10.2230967 0.00000000 1
## 94 0.05782208 2.4752041 0.14241022 1
## 95 2.53367393 49.9843155 340.72277916 0
## 96 0.74060910 36.4995043 4.50312148 1
## 97 0.80708405 4.8837325 5.41333688 1
## 98 0.58564967 0.9278714 2.85167528 1
## 99 1.65533067 62.6503184 44.22001168 1
## 100 0.94784219 42.4790524 7.86833705 1
## 101 0.84119511 4.6501098 5.93737399 1
## 102 1.88318015 20.8839055 75.41526879 1
## 103 0.41184731 11.4029323 1.58135246 1
## 104 2.09868025 12.3515166 124.51055442 1
## 105 0.97663292 7.0082665 8.47617167 1
## 106 1.44821011 25.9904310 27.06791213 1
## 107 2.12347272 29.3390041 131.88400976 1
## 108 1.07132447 123.2139364 10.78486107 1
## 109 1.80343313 21.6182719 62.59648794 1
## 110 0.00000000 1.7889788 0.00000000 1
## 111 0.00000000 10.9317631 0.00000000 1
## 112 1.13389947 51.5878305 12.61129580 1
## 113 0.53906244 3.1310271 2.45989116 1
## 114 1.54868038 14.9080484 34.37369129 1
## 115 0.83772947 1.4959394 5.88223453 1
## 116 0.70577580 86.0684237 4.07897173 1
## 117 0.78819906 29.0915206 5.14043390 1
## 118 1.72227622 31.7402860 51.75652955 1
## 119 1.02339821 12.8666891 9.55354121 1
## 120 0.79306494 34.6370853 5.20961879 1
## 121 2.76446761 34.5888453 580.39007101 1
## 122 0.16478915 11.1185327 0.46146747 1
## 123 2.61847597 47.6285919 414.40906201 0
## 124 2.28867018 61.3146089 193.38832670 1
## 125 0.78207686 2.7293337 5.05448015 1
## 126 0.26030714 15.8571484 0.82098822 1
## 127 0.42289247 1.4956789 1.64784448 1
## 128 0.71183934 11.2660561 4.15038075 1
## 129 1.73570816 23.5212137 53.41368734 1
## 130 0.00000000 1.8103287 0.00000000 1
## 131 1.18842716 8.4417522 14.43217590 1
## 132 1.43897112 65.5180899 26.47711407 1
## 133 2.75158819 41.1611271 563.40154117 1
## 134 2.48855760 55.0581658 307.00488362 0
## 135 0.86794498 20.4797528 6.37810755 1
## 136 0.15375896 6.8361061 0.42481657 1
## 137 0.45632576 3.5314239 1.85973480 1
## 138 0.14718638 3.8025013 0.40341585 1
## 139 0.10620013 2.5606953 0.27702715 1
Correlacion entre variables, distribución y scaterplots
ggpairs(covid_datos_1,title="Covid")
ggpairs(covid_datos_2,title="Covid")
ggpairs(covid_datos_3,title="Covid")
Análisis
La variable l10muertes.permil tiene las siguientes
correlaciónes
Positiva:
pob80 0.688 relacion fuerte
urbano 0.57 relacion fuerte
camas 0.3 relacion media
muertes.permil 0.7 relación fuerte
PBI 0.5 relación fuerte
Negativa:
Tuberculosis 0.4 relacion fuerte
Tempmarzo 0.5 relacion fuerte
BCG
De los scaterplot podemos concluir que tenemos una nube de puntos que podría explicarse con una regresión lineal simple para la población de 80 años y la zona urbana, como estas variables vs el logaritmo de las muertes por millón de habitante. También es para el caso de la variable PBI vs esta última. En el resto se observan nubes de puntos concentradas en algún cuadrante
Otras correlaciones interesantes son:
Tuberculosis y la temperatura de marzo, lo cual hace sentido dado que la posibilidad de padecer dicha enfermedad incrementa con temperaturas frías o disminuye para climas más tempaldos
La temperatura de marzo y las camas también presentan una correlación fuerte y negativa
EL PBI tiene una correlación negativa y debil comparda con la política de inmunización
Histogramas
Utilizamos histogramas para ver la distribución de las variables que nos resultan de mayor interes, en este caso seleccionamos PBI, Temperatura, Camas, urbano ,población de 80 años y el logaritmo de las muertes.
#PoblaDens, Pobla80,Urbano, l10muertes.permil,Tuberculosis,Camas, TempMarzo,PBI,muertes.permil,BCG
hp <- covid %>%
ggplot( aes(x=Pobla80)) +
geom_histogram( binwidth=3, fill="#69b3a2", color="#e9ecef", alpha=0.9) +
ggtitle("Distribucion de poblacion 80") +
theme_ipsum() +
theme(
plot.title = element_text(size=8)
)
hu <- covid %>%
ggplot( aes(x=Urbano)) +
geom_histogram( binwidth=3, fill="#9a76db", color="#e9ecef", alpha=0.9) +
ggtitle("Distribucion de urbano") +
theme_ipsum() +
theme(
plot.title = element_text(size=8)
)
hpb <- covid %>%
ggplot( aes(x=PBI)) +
geom_histogram( binwidth=3, fill="#60bd88", color="#e9ecef", alpha=0.9) +
ggtitle("Distribucion del PBI") +
theme_ipsum() +
theme(
plot.title = element_text(size=8)
)
ht <- covid %>%
ggplot( aes(x=TempMarzo)) +
geom_histogram( binwidth=3, fill="#609ebd", color="#e9ecef", alpha=0.9) +
ggtitle("Distribucion de la Temperatura en Marzo") +
theme_ipsum() +
theme(
plot.title = element_text(size=8)
)
ggarrange(hp,hu,hpb,ht,
nrow = 1,
ncol = 2
)
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## $`1`
##
## $`2`
##
## attr(,"class")
## [1] "list" "ggarrange"
Boxplot
bp <- covid %>%
ggplot(aes(y=Pobla80)) +
geom_boxplot(binwidth=0.5,fill="#69b3a2", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("Poblacion 80") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
bu <- covid %>%
ggplot(aes(y=Urbano)) +
geom_boxplot(binwidth=0.5,fill="#db769d", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("Urbano") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
bpbi <- covid %>%
ggplot(aes(y=PBI)) +
geom_boxplot(binwidth=0.5,fill="#9a76db", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("PBI") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
bt <- covid %>%
ggplot(aes(y=TempMarzo)) +
geom_boxplot(binwidth=0.5,fill="#bd6099", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("Temperatura") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
btu <- covid %>%
ggplot(aes(y=Tuberculosis)) +
geom_boxplot(binwidth=0.5,fill="#99bd60", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("Tuberculosis") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
bca <- covid %>%
ggplot(aes(y=Camas)) +
geom_boxplot(binwidth=0.5,fill="#bd9e60", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("Camas") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
blm <- covid %>%
ggplot(aes(y=l10muertes.permil)) +
geom_boxplot(binwidth=0.5,fill="#bd7660", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("Logaritmo Muertes") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
bpm <- covid %>%
ggplot(aes(y=muertes.permil)) +
geom_boxplot(binwidth=0.5,fill="#79ccd9", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("Muertes por millón") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
ggarrange( bp,bu,bpbi,bt,btu,bca,blm,bpm,
nrow = 1,
ncol = 2)
## $`1`
##
## $`2`
##
## $`3`
##
## $`4`
##
## attr(,"class")
## [1] "list" "ggarrange"
Las variables tuberculosis, camas y PBI presentas
valores atípicos de magnitud alta y positiva
Análisis boxplot para l10muertes.permil y
muertes.permil en relacion a BCGf
blm <- covid %>%
ggplot(aes(y=l10muertes.permil)) +
facet_wrap(~BCGf) +
geom_boxplot(binwidth=0.5,fill="#bd7660", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("Logaritmo Muertes") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
bpm <- covid %>%
ggplot(aes(y=muertes.permil)) +
facet_wrap(~BCGf) +
geom_boxplot(binwidth=0.5,fill="#79ccd9", color="#141414") +
theme_ipsum() +
theme(
legend.position="none",
plot.title = element_text(size=8)
) +
ggtitle("Muertes por millón") +
xlab("")
## Warning: Ignoring unknown parameters: binwidth
ggarrange( blm,bpm,
nrow = 1,
ncol = 1)
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family 'Arial Narrow' not found in PostScript font database
## $`1`
##
## $`2`
##
## attr(,"class")
## [1] "list" "ggarrange"
Análisis
Los efectos de la política de inmunización adoptada pueden verse reflejados de una manera más sencilla, dado que los correspondientes a no toman valores más altos relacionado a la muertes y menores para los de inmunización total. Lo cuál ayuda a la idea que en ese momento se tenía que esta inmunidad colaboraba a disminuir los efectos del covid
Por otro lado encambio para el caso de las muertes por millón no es tan sencillo diferenciar los efectos de la política implementada y esta variable se ve más influenciada por valores atípicos.
Vamos a realizar una matriz de correlación general considerando todas las variables
# Linda forma de visualizar la matriz de correlacion
ggcorr(covid, method = c("everything", "pearson"))
## Warning in ggcorr(covid, method = c("everything", "pearson")): data in column(s)
## 'geoId', 'CntrName', 'BCGf' are not numeric and were ignored
Claramente tener tantas variables contempladas en el gráfico no colabora pero es una buena forma de tener una idea rápida.
Vamos a considerar un número de variables reducidas para proponer un
modelo de regresión. Como variables regresoras tenemos
PoblaDens, Pobla80,Urbano, Tuberculosis, Camas, TempMarzo y PBI
utilizaremos como variable de respuesta a
l10muertes.permil
*Aclaración todas las variables son del tipo numérico
Generamos un dataframe con las variables seleccionadas unicamente
df_covid = data.frame(PoblaDens, Pobla80,Urbano, l10muertes.permil,Tuberculosis,Camas, TempMarzo,PBI)
df_covid
## PoblaDens Pobla80 Urbano l10muertes.permil Tuberculosis Camas
## 1 0.56937760 0.2771541 25.495 0.85166698 189.0 0.4363636
## 2 1.04612263 2.7410163 60.319 1.09735434 18.0 2.9375000
## 3 0.17730075 1.2709846 72.629 1.19736588 69.0 1.9000000
## 4 0.24713052 0.2723907 65.514 0.05301271 355.0 0.8000000
## 5 0.16258510 2.6111754 91.870 1.08768715 27.0 4.6000000
## 6 1.03680225 3.1239347 63.149 1.53403057 31.0 4.0200000
## 7 0.03249129 4.0436339 86.012 0.70937665 6.6 3.8783333
## 8 1.07206927 5.2369767 58.297 1.86867832 7.1 7.7000000
## 9 1.20265320 1.3597424 55.680 0.80830014 63.0 6.4666667
## 10 12.39579312 0.9964088 36.632 0.64062316 221.0 0.5750000
## 11 0.46728800 3.8045048 78.595 1.37219412 31.0 11.2000000
## 12 3.77214927 5.6948380 98.001 2.91424609 9.0 6.5500000
## 13 0.16793994 1.0395255 45.724 0.79385771 30.0 1.1600000
## 14 1.01853920 0.4365651 47.312 0.10078712 56.0 0.5000000
## 15 0.19777528 1.2095158 40.895 0.00000000 149.0 1.7333333
## 16 0.10480146 1.6248620 69.425 1.40930364 108.0 1.1000000
## 17 0.64920488 3.3861895 48.245 1.66678153 25.0 3.3666667
## 18 0.03977425 0.4939442 69.446 0.15945618 275.0 2.0000000
## 19 0.25061716 1.8060280 86.569 2.09062497 45.0 2.3285714
## 20 0.81396964 0.7583938 77.629 0.75300190 68.0 2.7542857
## 21 0.64703537 4.7222857 75.008 1.29960529 22.0 6.4888889
## 22 0.72191283 0.2453268 29.358 0.56624131 48.0 0.6500000
## 23 4.35178271 0.2917947 13.032 0.03722023 111.0 1.1333333
## 24 0.92056413 0.5703887 23.388 0.00000000 302.0 0.7600000
## 25 0.53343989 0.3083562 56.374 0.90413575 186.0 1.4000000
## 26 0.04075308 4.3071336 81.411 2.26374838 5.6 3.0714286
## 27 0.07490412 0.3528256 41.364 0.08432564 540.0 1.1000000
## 28 0.44748702 1.7597254 80.778 1.23486238 33.0 1.3166667
## 29 4.47244478 0.3889863 28.965 0.53185125 35.0 2.2000000
## 30 0.15356846 0.2877278 66.916 0.66491803 375.0 1.6000000
## 31 0.73077198 5.5638202 56.947 1.40989932 8.4 5.6354545
## 32 1.37602888 4.0918014 73.792 1.48902061 5.4 7.0100000
## 33 1.38067302 4.5174188 87.874 1.99324531 5.4 3.4111111
## 34 0.41368421 0.6099089 77.777 1.29603122 260.0 1.4571429
## 35 2.19978576 1.5873319 81.074 1.65899033 45.0 1.4375000
## 36 0.68788682 1.5376442 63.821 2.28487232 44.0 1.5285714
## 37 0.98873469 0.7910340 42.704 0.96804820 12.0 1.5100000
## 38 3.09881467 1.8419292 72.023 0.84966889 70.0 0.9900000
## 39 0.46665740 0.2886712 72.143 1.00721356 201.0 2.0666667
## 40 0.30386105 5.5491132 68.880 1.70728513 13.0 5.3600000
## 41 1.09224559 0.5012502 20.763 0.02322475 151.0 1.7500000
## 42 0.48357033 0.5795601 56.248 0.00000000 54.0 2.1475000
## 43 0.18156856 5.4057724 85.382 1.76134842 4.7 5.9600000
## 44 1.22338396 6.1032258 80.444 2.63132934 8.9 6.9222222
## 45 0.08224764 0.5335561 89.370 0.88115819 525.0 3.2000000
## 46 2.25306522 0.2595557 61.270 0.15793307 174.0 1.0000000
## 47 0.65275202 3.6827447 58.632 0.62493108 80.0 3.1222222
## 48 2.37370970 6.6270801 77.312 2.01040779 7.3 8.2555556
## 49 1.30821429 0.3266130 56.060 0.33086008 148.0 0.9000000
## 50 0.83224732 7.2679122 79.058 1.23366924 4.5 4.6555556
## 51 1.60953779 1.0548473 51.054 0.69394933 26.0 0.6250000
## 52 0.50522212 0.3195615 36.140 0.43000974 176.0 0.3000000
## 53 0.03957348 1.2722362 26.606 1.17956888 83.0 2.1600000
## 54 4.03598549 0.8276328 55.278 0.60817085 176.0 1.0000000
## 55 0.85687032 1.0293956 57.096 1.32704478 37.0 0.7285714
## 56 1.07906606 4.2713096 71.351 1.72513328 6.4 7.3000000
## 57 0.12291734 0.3130915 23.059 0.71053771 142.0 0.4000000
## 58 0.25189446 2.7008155 87.564 1.66184336 18.0 2.1714286
## 59 1.48348833 1.7877871 59.152 0.63650295 61.0 3.4066667
## 60 4.54938073 0.9448065 34.030 0.63846947 199.0 0.8000000
## 61 1.47752190 0.8561815 55.325 0.81312576 316.0 0.9000000
## 62 0.50222420 1.1233084 74.898 1.97066822 14.0 1.4400000
## 63 0.88530570 0.4831038 70.473 0.74455172 42.0 1.3100000
## 64 0.70452983 3.0188525 63.170 2.52768884 7.0 3.9555556
## 65 4.10526802 3.0461867 92.418 1.51362517 4.0 3.5333333
## 66 2.05450748 7.1734357 70.438 2.73899149 7.0 3.6875000
## 67 2.70993075 2.0456797 55.674 0.60923050 2.9 1.7571429
## 68 3.47073458 8.3613475 91.616 0.89103814 14.0 13.7960000
## 69 1.12142498 0.6023762 90.979 0.27966158 5.0 1.7818182
## 70 0.06769826 1.4932044 57.428 0.48064752 68.0 7.4111111
## 71 0.90299417 0.2699139 27.030 0.31600904 292.0 1.4000000
## 72 2.32172222 0.2327419 100.000 1.63646809 23.0 1.9800000
## 73 0.30983307 5.5652960 68.142 1.11188355 29.0 6.8111111
## 74 6.69494135 1.4828557 88.593 0.68089875 11.0 3.3800000
## 75 0.69437813 0.8209008 28.153 0.00000000 611.0 1.3000000
## 76 0.50030907 0.3996440 51.151 0.81973136 308.0 0.7500000
## 77 0.03795632 0.7605248 80.102 0.20382969 40.0 3.6700000
## 78 0.44531351 5.8370281 67.679 1.39199086 44.0 7.1666667
## 79 2.50093827 4.0235270 90.981 2.26007623 8.0 5.3727273
## 80 0.45139856 0.4241700 37.191 0.03187466 233.0 0.2500000
## 81 1.92440762 0.3087382 16.937 0.08652600 181.0 1.2000000
## 82 0.95962821 1.0741699 76.036 0.66721788 92.0 1.8312500
## 83 0.15635016 0.2683715 42.356 0.66924316 53.0 0.3333333
## 84 0.04272164 0.4204185 53.672 0.66592067 93.0 0.4000000
## 85 6.23301970 2.0227961 40.793 0.94954834 13.0 3.2333333
## 86 0.64914626 1.5523039 80.156 1.83964772 23.0 1.5888889
## 87 1.23519804 2.2672524 42.629 1.89361039 86.0 6.1666667
## 88 0.02040609 0.6283914 68.445 0.00000000 428.0 6.3266667
## 89 0.46271004 3.4204855 66.813 1.18924972 15.0 4.0125000
## 90 0.80728519 1.1687236 62.453 0.81997625 99.0 0.9800000
## 91 0.37508535 0.3481273 35.988 0.01447977 551.0 0.7666667
## 92 0.82238615 0.7791075 30.579 0.04599322 338.0 0.7500000
## 93 0.02973746 0.6151794 50.032 0.00000000 524.0 3.0000000
## 94 1.95939107 0.7516195 19.740 0.05782208 151.0 2.6500000
## 95 5.11457910 4.6976392 91.490 2.53367393 5.3 4.6000000
## 96 0.18554176 3.7311137 86.538 0.74060910 7.3 2.5500000
## 97 0.53727048 1.1025688 58.522 0.80708405 41.0 0.9222222
## 98 0.17717651 0.2340882 16.425 0.58564967 87.0 0.3000000
## 99 0.14554920 4.2231531 82.248 1.65533067 4.1 4.2555556
## 100 0.15604145 0.4596337 84.539 0.94784219 5.9 1.8600000
## 101 2.75289319 0.6545620 36.666 0.84119511 265.0 0.7200000
## 102 0.56186077 1.9205337 67.709 1.88318015 52.0 2.2888889
## 103 0.17508359 1.2135437 61.585 0.41184731 43.0 1.2857143
## 104 0.24991606 1.6809015 77.907 2.09868025 123.0 1.4875000
## 105 3.57688305 0.7893793 46.907 0.97663292 554.0 0.5833333
## 106 1.24035886 4.4631164 60.058 1.44821011 16.0 6.5222222
## 107 1.12239454 6.3408699 65.211 2.12347272 24.0 3.4222222
## 108 2.39593196 0.1847213 99.135 1.07132447 31.0 1.6400000
## 109 0.84639847 4.7084438 53.998 1.80343313 68.0 6.4555556
## 110 4.98659870 0.3624706 17.211 0.00000000 59.0 1.6000000
## 111 2.82589744 2.4482249 52.198 0.00000000 6.3 3.3000000
## 112 0.15676654 0.5038453 83.844 1.13389947 10.0 2.2500000
## 113 0.82347478 0.3825330 47.192 0.53906244 118.0 0.2000000
## 114 0.79831740 4.0191136 56.092 1.54868038 17.0 5.6125000
## 115 1.05987171 0.3522140 42.055 0.83772947 298.0 0.4000000
## 116 79.52998418 2.1766595 100.000 0.70577580 47.0 2.7457143
## 117 1.13290578 3.2223629 53.726 0.78819906 5.8 6.3400000
## 118 1.02639860 5.3152643 54.541 1.72227622 5.3 4.6555556
## 119 0.47630120 0.7184723 66.355 1.02339821 520.0 2.8000000
## 120 5.29652104 3.2120425 81.459 0.79306494 66.0 10.6080000
## 121 0.93529058 6.1672057 80.321 2.76446761 9.4 3.1888889
## 122 3.45558922 1.6065781 18.476 0.16478915 64.0 3.5500000
## 123 0.25001043 5.1726032 87.431 2.61847597 5.5 2.7666667
## 124 2.15521378 5.1493834 73.797 2.28867018 6.4 5.1222222
## 125 0.65572714 0.5234433 27.134 0.78207686 84.0 5.2666667
## 126 1.35897207 2.5315654 49.949 0.26030714 153.0 2.1000000
## 127 1.45046773 0.2700138 41.702 0.42289247 36.0 0.8000000
## 128 0.74441323 1.7197442 68.945 0.71183934 35.0 2.0545455
## 129 1.06960129 1.6774797 75.143 1.73570816 16.0 2.4555556
## 130 2.13061734 0.2057545 23.774 0.00000000 200.0 0.7500000
## 131 0.77029667 3.9876216 69.352 1.18842716 80.0 8.9222222
## 132 1.35609110 0.1307769 86.522 1.43897112 1.0 1.6777778
## 133 2.74827392 5.0282090 83.398 2.75158819 8.0 3.2111111
## 134 0.35766089 3.8751036 82.256 2.48855760 3.0 3.0333333
## 135 0.19708028 4.3947641 95.334 0.86794498 33.0 2.5250000
## 136 0.77469205 0.8369038 50.478 0.15375896 70.0 4.5888889
## 137 0.53977853 0.3498816 36.642 0.45632576 48.0 0.6900000
## 138 0.23341479 0.2529708 43.521 0.14718638 346.0 1.9500000
## 139 0.37324591 0.4222739 32.209 0.10620013 210.0 2.3500000
## TempMarzo PBI
## 1 7.60 1.8351696
## 2 6.04 11.3351950
## 3 17.91 14.1967389
## 4 22.78 6.7205961
## 5 17.51 20.0684923
## 6 -0.57 8.3491802
## 7 25.37 45.7525548
## 8 1.42 48.9687140
## 9 4.97 17.0906963
## 10 25.42 3.3061083
## 11 -0.69 18.1721809
## 12 5.23 45.2631622
## 13 24.45 8.0937796
## 14 30.14 2.0675705
## 15 5.68 8.3417246
## 16 22.07 6.5317860
## 17 4.01 11.6971771
## 18 24.30 16.1336867
## 19 25.49 15.5847506
## 20 25.92 80.8004129
## 21 4.70 17.9465777
## 22 30.63 1.6709928
## 23 20.43 0.7568378
## 24 27.93 3.3333517
## 25 26.27 3.2930885
## 26 -18.72 44.2264907
## 27 26.96 0.8532664
## 28 25.14 13.2116325
## 29 25.20 2.6420144
## 30 25.60 5.6636489
## 31 5.83 22.9922117
## 32 2.80 32.7718057
## 33 2.24 48.5249925
## 34 25.75 2.7442687
## 35 22.88 13.9050879
## 36 21.93 10.8759023
## 37 17.83 10.8110341
## 38 25.70 7.2348467
## 39 25.04 30.5908474
## 40 -2.35 28.8340001
## 41 23.48 1.5126247
## 42 25.00 8.8754441
## 43 -6.09 42.8552430
## 44 6.37 40.3515680
## 45 26.14 17.0778163
## 46 27.32 2.4051919
## 47 0.72 9.5834608
## 48 3.87 46.5762068
## 49 29.52 3.9219764
## 50 8.19 27.2065489
## 51 22.94 7.5159291
## 52 27.63 2.0022876
## 53 25.65 7.1987245
## 54 23.47 1.7058976
## 55 23.38 4.4336960
## 56 5.44 25.7573736
## 57 26.55 2.0073216
## 58 10.87 22.2523960
## 59 0.49 13.5313781
## 60 23.45 5.8366566
## 61 25.79 10.5772045
## 62 11.33 18.4501839
## 63 15.12 15.8895142
## 64 6.00 59.3055780
## 65 14.96 34.5710854
## 66 6.52 37.7630816
## 67 23.44 8.5085469
## 68 2.52 39.1530060
## 69 13.08 9.2014965
## 70 -3.96 24.1030338
## 71 26.10 2.8839337
## 72 19.23 75.8307296
## 73 -1.37 23.8146826
## 74 10.39 13.2450688
## 75 15.13 2.9043623
## 76 26.44 1.2563111
## 77 17.76 19.3396159
## 78 -0.47 27.8087523
## 79 4.70 100.2191161
## 80 23.99 1.7044431
## 81 23.25 1.1836484
## 82 25.19 25.8714034
## 83 27.34 2.0131236
## 84 25.29 3.8172107
## 85 25.48 19.3987280
## 86 18.44 17.8555895
## 87 2.93 5.8933274
## 88 -8.80 11.1277975
## 89 2.53 16.2734892
## 90 13.09 7.4795258
## 91 25.48 1.2616857
## 92 22.74 5.0214146
## 93 22.67 10.2230967
## 94 10.02 2.4752041
## 95 4.95 49.9843155
## 96 13.60 36.4995043
## 97 24.95 4.8837325
## 98 26.01 0.9278714
## 99 -5.49 62.6503184
## 100 23.40 42.4790524
## 101 16.01 4.6501098
## 102 25.44 20.8839055
## 103 25.84 11.4029323
## 104 19.99 12.3515166
## 105 25.13 7.0082665
## 106 2.65 25.9904310
## 107 11.33 29.3390041
## 108 21.78 123.2139364
## 109 3.40 21.6182719
## 110 19.25 1.7889788
## 111 25.90 10.9317631
## 112 20.60 51.5878305
## 113 28.47 3.1310271
## 114 4.91 14.9080484
## 115 27.65 1.4959394
## 116 28.62 86.0684237
## 117 2.40 29.0915206
## 118 3.38 31.7402860
## 119 21.10 12.8666891
## 120 3.66 34.6370853
## 121 8.60 34.5888453
## 122 27.03 11.1185327
## 123 -4.98 47.6285919
## 124 0.09 61.3146089
## 125 -3.08 2.7293337
## 126 27.38 15.8571484
## 127 29.31 1.4956789
## 128 14.21 11.2660561
## 129 4.77 23.5212137
## 130 23.68 1.8103287
## 131 1.18 8.4417522
## 132 22.61 65.5180899
## 133 4.66 41.1611271
## 134 0.06 55.0581658
## 135 21.26 20.4797528
## 136 5.38 6.8361061
## 137 20.82 3.5314239
## 138 22.90 3.8025013
## 139 22.92 2.5606953
Aunque hemos realizado un análisis exploratorio de datos, es importante como primer paso para establecer un modelo lineal múltiple es estudiar la relación que existe entre las variables seleccionadas arriba. Esta información es crítica a la hora de identificar cuáles pueden ser los mejores predictores para el modelo, qué variables presentan relaciones de tipo no lineal (por lo que no pueden ser incluidas) y para identificar colinialidad entre predictores.
round(cor(x = df_covid, method = "pearson"), 3)
## PoblaDens Pobla80 Urbano l10muertes.permil Tuberculosis
## PoblaDens 1.000 0.011 0.127 -0.038 -0.054
## Pobla80 0.011 1.000 0.469 0.668 -0.481
## Urbano 0.127 0.469 1.000 0.572 -0.374
## l10muertes.permil -0.038 0.668 0.572 1.000 -0.481
## Tuberculosis -0.054 -0.481 -0.374 -0.481 1.000
## Camas 0.004 0.714 0.370 0.364 -0.331
## TempMarzo 0.115 -0.681 -0.322 -0.511 0.367
## PBI 0.263 0.452 0.665 0.539 -0.405
## Camas TempMarzo PBI
## PoblaDens 0.004 0.115 0.263
## Pobla80 0.714 -0.681 0.452
## Urbano 0.370 -0.322 0.665
## l10muertes.permil 0.364 -0.511 0.539
## Tuberculosis -0.331 0.367 -0.405
## Camas 1.000 -0.712 0.368
## TempMarzo -0.712 1.000 -0.350
## PBI 0.368 -0.350 1.000
ggcorr(df_covid, method = c("everything", "pearson"))
Del análisis preliminar se pueden extraer las siguientes conclusiones:
Las variables que tienen una mayor relación lineal con la mortalidad son: poblacion 80 (r= 0.68), urbano (r= -0.57) y PBI (r= 0.54). La poblacion de 80 y las camas están medianamente correlacionados (r = 0.7) por lo que posiblemente no sea útil introducir ambos predictores en el modelo. Lo mismo sucede para la temperatura y las camas
Para realizar un primer modelo de regresion lineal utilizaremos la variable de Pobla80 ya que presenta una correlación alta y considerando el contexto que se trata de la población de mayor riesgo frente al COVID-19
Crearemos un modelo lineal considerando como variable de respuesta
l10muertes.permil y regresoras
Pobla80-PoblaDens-Urbano-Tuberculosis-Camas -TempMarzo -PBI
modelo <- lm(l10muertes.permil ~ Pobla80+PoblaDens+Urbano+Tuberculosis+Camas+TempMarzo+PBI , data = df_covid )
summary(modelo)
##
## Call:
## lm(formula = l10muertes.permil ~ Pobla80 + PoblaDens + Urbano +
## Tuberculosis + Camas + TempMarzo + PBI, data = df_covid)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.08088 -0.29012 -0.03314 0.27929 1.29267
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.5981046 0.2012630 2.972 0.00352 **
## Pobla80 0.2040913 0.0338369 6.032 1.55e-08 ***
## PoblaDens -0.0111873 0.0063386 -1.765 0.07990 .
## Urbano 0.0082702 0.0025767 3.210 0.00167 **
## Tuberculosis -0.0005815 0.0003431 -1.695 0.09246 .
## Camas -0.1101291 0.0263087 -4.186 5.17e-05 ***
## TempMarzo -0.0143117 0.0057068 -2.508 0.01337 *
## PBI 0.0062466 0.0027181 2.298 0.02314 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4765 on 131 degrees of freedom
## Multiple R-squared: 0.6239, Adjusted R-squared: 0.6038
## F-statistic: 31.04 on 7 and 131 DF, p-value: < 2.2e-16
Análisis preliminar, esta regresión es capaz de explicar el 62,3% de
lo que ocurre en la regresión,presenta un p-valor pequeño y
un RSS de 0.476. Nuestro modelo es: \[\hat{l10muertes.pormil} =
0.59+0.20\hat{Pobla80}-0.01\hat{PoblaDens}\] \[+0.008\hat{Urbano}-0.0005\hat{Tuberculosis}\]
\[-0.11\hat{Camas}-0.014\hat{TempMarzo}+0.006\hat{PBI}\]
El intercept es de signo positivo por lo que nos indica una pendiente creciente, aquellos estimadores con signo negativo tienen sentido dado que si uno tiene menor densidad población debería tener menos riesgo de contacto porque hay menor concentración de personas, lo mismo sucede con las camas mayor cantidad de camas, más pacientes pueden ser atendidos y menos muertes se generarias, con la temperatura considerando que es una enfermedad del tipo respiratoria auqellos países que no esten en invieron u otoño presentarán menos casos que los que si se encuentren, por otro lado mayor poblacion adulta implica mayor cantidad de muertos por ser el grupo de riesgo y el PBI al ser un indicador económico uno podría asumir que países con PBI bajo no tendrán buenos sistemas de salud.
df_covid$studentized_residual <- rstudent(modelo)
ggplot(data = df_covid, aes(x = predict(modelo), y = abs(studentized_residual))) +
geom_hline(yintercept = 3, color = "grey", linetype = "dashed") +
# se identifican en rojo observaciones con residuos estandarizados absolutos > 3
geom_point(aes(color = ifelse(abs(studentized_residual) > 3, 'red', 'black'))) +
scale_color_identity() +
labs(title = "Distribución de los residuos studentized",
x = "predicción modelo") +
theme_bw() + theme(plot.title = element_text(hjust = 0.5))
which(abs(df_covid$studentized_residual) > 3)
## integer(0)
Realizando el gráfico de los residuos estandarizados y nuestro test para idetificar valores atipicos se concluye que no se encuentra ninguno. Sin embargo el gráfico presenta una leve concentración en la esquina izquierda correspondiente a valores pequeños hasta el 0.5 de predicción y luego se los ve dispersos.
Vamos a generar una tabla que nos permita cuantificar la influencia de las observaciones que son significativamente influyentes en nuestro predictor.
summary(influence.measures(modelo))
## Potentially influential observations of
## lm(formula = l10muertes.permil ~ Pobla80 + PoblaDens + Urbano + Tuberculosis + Camas + TempMarzo + PBI, data = df_covid) :
##
## dfb.1_ dfb.Pb80 dfb.PblD dfb.Urbn dfb.Tbrc dfb.Cams dfb.TmpM dfb.PBI
## 26 -0.05 0.00 -0.01 -0.01 -0.01 0.05 0.08 -0.01
## 36 0.01 0.01 -0.03 0.13 -0.18 -0.07 0.09 -0.15
## 68 0.59 -0.23 0.02 -0.03 -0.10 -0.76 -0.54 0.09
## 75 -0.03 -0.05 -0.01 0.06 -0.23 0.05 0.07 -0.05
## 79 0.00 -0.01 -0.03 -0.04 0.02 0.00 0.00 0.12
## 87 0.26 -0.24 0.08 -0.15 -0.09 0.31 -0.18 -0.12
## 88 -0.08 0.29 -0.05 -0.16 -0.29 -0.11 0.36 0.08
## 96 0.07 -0.17 0.09 -0.16 0.03 0.19 -0.03 -0.01
## 108 -0.01 0.30 0.28 0.18 -0.03 -0.01 -0.09 -0.89
## 116 0.12 0.03 -2.51_* -0.11 -0.06 0.07 0.09 0.03
## 120 0.01 0.01 0.00 0.00 0.00 -0.02 0.00 0.00
## dffit cov.r cook.d hat
## 26 -0.08 1.25_* 0.00 0.15
## 36 0.38 0.68_* 0.02 0.02
## 68 -1.02_* 1.08 0.13 0.22_*
## 75 -0.26 1.19_* 0.01 0.13
## 79 0.14 1.22_* 0.00 0.13
## 87 0.59 0.72_* 0.04 0.05
## 88 -0.58 1.17 0.04 0.17_*
## 96 -0.40 0.79_* 0.02 0.03
## 108 -1.00_* 1.30_* 0.12 0.29_*
## 116 -2.68_* 18.90_* 0.90 0.95_*
## 120 -0.03 1.22_* 0.00 0.13
La visualización gráfica de las influencias se obtiene:
influencePlot(modelo)
## StudRes Hat CookD
## 36 2.8089529 0.01799481 0.01717000
## 68 -1.9489237 0.21623105 0.12824793
## 87 2.7010994 0.04527254 0.04126294
## 108 -1.5498732 0.29469147 0.12412726
## 116 -0.6456102 0.94517926 0.90231428
Los análisis muestran varias observaciones influyentes (posición 116 , 108 y 68) que exceden los límites de preocupación para los valores de Leverages o Distancia Cook. Estudios más exhaustivos consistirían en rehacer el modelo sin las observaciones y ver el impacto.
Los gráficos de la distancia de Cook sirven para detectar observaciones que influyen fuertemente en los valores ajustados del modelo.
Los análisis muestran varias observaciones influyentes que exceden los límites de preocupación para los valores de Leverages o Distancia Cook
**Posicion 116 = Singapurm 108 = Qatar y 68 = Japon
1- Relación lineal entre el predictor numérico y la variable respuesta
Podemos validar que sucede con esta condición utilizando un scatterplot entre la cantidad de muertes y las distintas features seleccionadas
Poblacion de 80
PoblaDens+Urbano+Tuberculosis+Camas+TempMarzo+PBI
plot1 <- ggplot(data = df_covid, aes(Pobla80, modelo$residuals)) +
geom_point() + geom_smooth(color = "firebrick") + geom_hline(yintercept = 0) +
theme_bw()
plot1
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
Los residuos se encuentran en su mayoría concentrados entre el 0 y 2
de Pobla80y entre el 0.5 y -05 de los residuos
estandarizados, , la variable es constante hasta que cae. Podemos decir
que se cumple la linealidad para el predictor seleccionado.
Poblacion Densidad
plot1 <- ggplot(data = df_covid, aes(PoblaDens, modelo$residuals)) +
geom_point() + geom_smooth(color = "firebrick") + geom_hline(yintercept = 0) +
theme_bw()
plot1
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
Los residuos se encuentran en su mayoría concentrados en el cuadrante izquierdo del grafico, Podemos decir que no se cumple la linealidad para el predictor seleccionado.
Urbano
plot1 <- ggplot(data = df_covid, aes(Urbano, modelo$residuals)) +
geom_point() + geom_smooth(color = "firebrick") + geom_hline(yintercept = 0) +
theme_bw()
plot1
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
Los residuos se encuentran en su mayoría distribuidos aleatoriamente entorno al 0, la variable es constante Podemos decir que se cumple la linealidad para el predictor seleccionado.
Tuberculosis
plot1 <- ggplot(data = df_covid, aes(Tuberculosis, modelo$residuals)) +
geom_point() + geom_smooth(color = "firebrick") + geom_hline(yintercept = 0) +
theme_bw()
plot1
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
Los residuos se encuentran en su mayoría concentrados entre el 0 y
100 de Tuberculosisy entre el 1 y -1 de los residuos
estandarizados, la variable es constante a lo largo de todos los
valores. Podemos decir que se cumple la linealidad para el predictor
seleccionado.
Camas
plot1 <- ggplot(data = df_covid, aes(Camas, modelo$residuals)) +
geom_point() + geom_smooth(color = "firebrick") + geom_hline(yintercept = 0) +
theme_bw()
plot1
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
Los residuos se encuentran en su mayoría dsiperos entre los valores 0
a 5 de Camas, la variable es constante hasta que cae.
Podemos decir que se cumple la linealidad para el predictor
seleccionado.
Temprartura Marzo
plot1 <- ggplot(data = df_covid, aes(TempMarzo, modelo$residuals)) +
geom_point() + geom_smooth(color = "firebrick") + geom_hline(yintercept = 0) +
theme_bw()
plot1
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
Los residuos se encuentran en su mayoría distribuidos a lo largo del cero podemos ver como dos grandes grupos que podrían ser consecuencia de que el hemisferio Sur y el hemisferio norte presentan estaciones opuestas.Podemos decir que se cumple la linealidad para el predictor seleccionado.
PBI
plot1 <- ggplot(data = df_covid, aes(PBI, modelo$residuals)) +
geom_point() + geom_smooth(color = "firebrick") + geom_hline(yintercept = 0) +
theme_bw()
plot1
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
Los residuos se encuentran en su mayoría concentrados entre el 0 y 25
de PBIy entre el 0.5 y -0.5 de los residuos
estandarizados,, la variable es constante hasta que cae consecuencia de
un punto. Podemos decir que se cumple la linealidad para el predictor
seleccionado, si consideramos que hay puntos muy disperos.
2- Distribución normal de los residuos
Vamos a comparar los cuantiles de la distribución observada con los cuantiles teóricos de una distribución normal con la misma media y desviación estándar que los datos.
qqnorm(modelo$residuals)
qqline(modelo$residuals)
ks.test(modelo$residuals,"pnorm",mean(modelo$residuals),sd(modelo$residuals))
##
## One-sample Kolmogorov-Smirnov test
##
## data: modelo$residuals
## D = 0.048945, p-value = 0.8931
## alternative hypothesis: two-sided
El análisis gráfico confirman la normalidad, debido a que estos se encuentran en su mayoria alienados entorno a la recta, con una leve “desprendimiento” en las colas, Realizando el test de bondad de ajuste dado que mi p-value es de 0.89, estoy en condiciones de rechazar mi hipotesis nula y afirmar que tienen distribucion normal
3-Variabilidad constante de los residuos
(homocedasticidad)
Vamos a graficar los valores ajustado por el modelo y los residuos.
ggplot(data = df_covid, aes(modelo$fitted.values, modelo$residuals)) +
geom_point() +
geom_smooth(color = "firebrick", se = FALSE) +
geom_hline(yintercept = 0) +
theme_bw()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
#bptest(modelo)
Como la distribución de los residuos frente a los valores ajustados por el modelo, se distribuyen distribuir de forma aleatoria en torno a cero, pero en forma de huevo , se da cuando la variable de respuesta es una proporción.Lo que esta pasando es que estamos violando el principio de heterocedasticidad que habla de que la varianza de todos los errores sea igual.
Para saber si tengo un problema de heterocedasticidad puedo realizar un test para saber realmente si pasa. Lo que voy a testear es que la varianza de cada uno de mis errores es la misma vs la hipótesis alternativa de que hay alguno distinto
cor.test(abs(modelo$residuals),modelo$fitted.values,method="spearman")
##
## Spearman's rank correlation rho
##
## data: abs(modelo$residuals) and modelo$fitted.values
## S = 367626, p-value = 0.0355
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.1786362
No hay un problema de heterosticidad dado que el p-value no nos dió un valor tan pequeño
4- No multicolinialidad
Matriz de correlación entre predictores.
corrplot(cor(dplyr::select(df_covid, PoblaDens, Pobla80,Urbano, l10muertes.permil,Tuberculosis,Camas, TempMarzo,PBI, l10muertes.permil)),
method = "number", tl.col = "black")
5 -Análisis de Inflación de Varianza (VIF)
vif(modelo)
## Pobla80 PoblaDens Urbano Tuberculosis Camas TempMarzo
## 2.772879 1.141569 1.934049 1.397990 2.567937 2.438824
## PBI
## 2.091513
No hay predictores que muestren una correlación lineal muy alta ni inflación de varianza.
6- Autocorrelacion
dwt(modelo, alternative = "two.sided")
## lag Autocorrelation D-W Statistic p-value
## 1 0.06317665 1.870852 0.41
## Alternative hypothesis: rho != 0
No hay evidencia de autocorrelación
El PBI presenta una correlación fuerte y positiva, con las muertes las camas de hospitales y la población de 80, lo que hace sentido dado que podríamos asumir que aquellos países que presentan un menor PBI pueden no contar con buenos sistemas de salud lo que podría ocacionar mayor cantidad de muertes.
Vamos a crear una serie de columnas nuevas correspondientes a diversas interacciones con el PBI
modelo_pbi1 <- lm(l10muertes.permil ~ PoblaDens+Pobla80*PBI+Urbano*PBI+Tuberculosis*PBI+PBI*Camas+TempMarzo+PBI, data = df_covid )
summary(modelo_pbi1)
##
## Call:
## lm(formula = l10muertes.permil ~ PoblaDens + Pobla80 * PBI +
## Urbano * PBI + Tuberculosis * PBI + PBI * Camas + TempMarzo +
## PBI, data = df_covid)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.12733 -0.27284 -0.02685 0.32828 1.29753
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.623e-01 2.673e-01 1.355 0.177753
## PoblaDens -1.013e-02 6.855e-03 -1.477 0.142099
## Pobla80 8.080e-02 6.990e-02 1.156 0.249859
## PBI 2.544e-02 1.489e-02 1.709 0.089951 .
## Urbano 1.048e-02 3.037e-03 3.452 0.000756 ***
## Tuberculosis -5.342e-04 5.173e-04 -1.033 0.303647
## Camas -4.365e-02 5.693e-02 -0.767 0.444613
## TempMarzo -9.900e-03 6.371e-03 -1.554 0.122712
## Pobla80:PBI 3.725e-03 2.116e-03 1.760 0.080817 .
## PBI:Urbano -2.084e-04 1.534e-04 -1.359 0.176667
## PBI:Tuberculosis -1.722e-05 4.906e-05 -0.351 0.726177
## PBI:Camas -2.408e-03 1.893e-03 -1.273 0.205515
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4743 on 127 degrees of freedom
## Multiple R-squared: 0.6387, Adjusted R-squared: 0.6074
## F-statistic: 20.41 on 11 and 127 DF, p-value: < 2.2e-16
Podemos observar un leve incremento en el \(R^2\) lógico porque sumamos una feature. Dado que esto no nos es representativo veamos que pasa con los residuos
par(mfrow=c(2,2))
plot(modelo_pbi1)
Realizando interacciones con el PBI se logran mejorar las salidas no pareciera que afectara a los residuos
Cosndierando como criterios de evaluación el \(R^2, p-value, RSS\) y sus residuos, el mejor modelo que tenemos es aquel que considera las variables sin ninguna interaccion con el PBI, en otras palabras:
\[\hat{l10muertes.pormil} = 0.59+0.20\hat{Pobla80}-0.01\hat{PoblaDens}\] \[+0.008\hat{Urbano}-0.0005\hat{Tuberculosis}\] \[-0.11\hat{Camas}-0.014\hat{TempMarzo}+0.006\hat{PBI}\]
El modelo con todas las variables introducidas como predictores tiene un \(R^2\) alta (0.6239), es capaz de explicar el 62,39% de la variabilidad observada en la mortalidad logarimica por millon de habitantes para el covid-19. El \(p-value\) del modelo es significativo (\(2.2e^{-16}\)) por lo que se puede aceptar que el modelo no es por azar, al menos uno de los coeficientes parciales de regresión es distinto de 0. Muchos de ellos no son significativos, lo que es un indicativo de que podrían no contribuir al modelo.
Varios de los datos con los que se cuentan debido a como fueron cosnturidos y lo que representan, contarán con una alta colinealidad. De este conocimiento previo podemos identifcar los siguientes casos:
Todo lo que represente porcentaje poblacional, tiene una relación
con la población total (PoblaData). A su vez muchos de
estos también tienen una relacion entre ellos porque en algunos casos
estan incluidos en ese porcentaje, el caso del porcentaje de la
población de 65 años incluye a la población de 80.
Por como esta construida Pobla80 que es un promedio
entre Female80 y Male80.
La densidad poblaciónal tiene que tener una correlación fuerte con la poblacion total dado que es un inidcador que se contruye como población total / superficie
El PBI en este caso representa el PPP y su construcción es el PBI/cantidad total de habitantes
HipTen por consturcción es un promedio de
HT.women y HT.men
l10muertes.permil por construcción donde
muertes.permil es el número de muertos cada millón de
habitantes.
BCGy BCGfrepresentan lo mismo dado que
es la variables BCG escrita como un factor.
Tenemos varias formas de corroborar lo que mencionamos una podría ser viendo la correlación entre estas variables y otra generando un modelo de regresión con estos predictores y observar el\(R^2\)
# Excluimos las variables categoricas
df_covid_total = data.frame(Hombres80, Mujeres80, Pobla80, Pobla65, PoblaMid, PoblaData, PoblaDens, Mujeres, Urbano,ExpectVida, NeontlMort, DisMort, Lesion, EnfNoTrans,Tuberculosis,Diabetes, ImmunSaramp, HipTen.H, HipTen.M, BCG,Medicos,Camas,PBI,TempMarzo,l10muertes.permil,muertes.permil)
df_covid_total
## Hombres80 Mujeres80 Pobla80 Pobla65 PoblaMid PoblaData PoblaDens
## 1 0.23332582 0.3209823 0.2771541 2.584927 54.32490 0.37172386 0.56937760
## 2 2.44807869 3.0339539 2.7410163 13.744736 68.58239 0.02866376 1.04612263
## 3 1.18175550 1.3602137 1.2709846 6.362497 63.48882 0.42228429 0.17730075
## 4 0.20753263 0.3372488 0.2723907 2.216374 50.97470 0.30809762 0.24713052
## 5 1.77481880 3.4475320 2.6111754 11.117789 64.12128 0.44494502 0.16258510
## 6 2.45959960 3.7882699 3.1239347 11.253818 68.11276 0.02951776 1.03680225
## 7 3.40801882 4.6792491 4.0436339 15.656475 65.15291 0.24992369 0.03249129
## 8 3.92008681 6.5538665 5.2369767 19.001566 66.70049 0.08847037 1.07206927
## 9 0.98233980 1.7371450 1.3597424 6.195183 70.43525 0.09942334 1.20265320
## 10 0.92567665 1.0671409 0.9964088 5.158391 67.13559 1.61356039 12.39579312
## 11 1.98505780 5.6239517 3.8045048 14.845148 68.28891 0.09485386 0.46728800
## 12 4.26847412 7.1212019 5.6948380 18.788744 64.15583 0.11422068 3.77214927
## 13 1.04770490 1.0313461 1.0395255 4.736459 64.98378 0.00383071 0.16793994
## 14 0.33308679 0.5400435 0.4365651 3.253605 54.29871 0.11485048 1.01853920
## 15 1.20832395 1.2107077 1.2095158 6.003012 68.22563 0.00754394 0.19777528
## 16 1.36894924 1.8807749 1.6248620 7.191947 61.73450 0.11353142 0.10480146
## 17 2.62930836 4.1430706 3.3861895 16.470317 68.76346 0.03323929 0.64920488
## 18 0.32968114 0.6582073 0.4939442 4.223874 61.66318 0.02254126 0.03977425
## 19 1.38043099 2.2316251 1.8060280 8.922838 69.74309 2.09469333 0.25061716
## 20 0.68594552 0.8308421 0.7583938 4.873148 72.10039 0.00428962 0.81396964
## 21 3.47833930 5.9662322 4.7222857 21.021914 64.38262 0.07024216 0.64703537
## 22 0.17806863 0.3125849 0.2453268 2.406981 52.64494 0.19751535 0.72191283
## 23 0.22728873 0.3563006 0.2917947 2.246940 52.25138 0.11175378 4.35178271
## 24 0.44915480 0.6916225 0.5703887 4.568680 64.22991 0.16249798 0.92056413
## 25 0.24541433 0.3712980 0.3083562 2.728877 54.63954 0.25216237 0.53343989
## 26 3.44384968 5.1704175 4.3071336 17.232007 66.89774 0.37058856 0.04075308
## 27 0.22803331 0.4776179 0.3528256 2.825774 52.87991 0.04666377 0.07490412
## 28 1.48426928 2.0351814 1.7597254 8.478047 68.44406 0.49648685 0.44748702
## 29 0.31250447 0.4654681 0.3889863 3.007009 57.45457 0.00832322 4.47244478
## 30 0.20761885 0.3678366 0.2877278 2.681720 55.55478 0.05244363 0.15356846
## 31 3.64181309 7.4858273 5.5638202 20.445433 65.04263 0.04089400 0.73077198
## 32 2.83741960 5.3461832 4.0918014 19.420877 64.99252 0.10625695 1.37602888
## 33 3.56907492 5.4657626 4.5174188 19.812953 63.72878 0.05797446 1.38067302
## 34 0.51375834 0.7060595 0.6099089 4.527579 65.89830 0.00958920 0.41368421
## 35 1.41201959 1.7626442 1.5873319 7.082817 64.94005 0.10627165 2.19978576
## 36 1.31184512 1.7634434 1.5376442 7.157290 64.81412 0.17084357 0.68788682
## 37 0.59376508 0.9883030 0.7910340 5.229779 60.97150 0.98423595 0.98873469
## 38 1.64624432 2.0376142 1.8419292 8.287090 64.58083 0.06420744 3.09881467
## 39 0.23244491 0.3448975 0.2886712 2.457877 60.42552 0.01308974 0.46665740
## 40 3.14651675 7.9517097 5.5491132 19.626357 64.01657 0.01320884 0.30386105
## 41 0.45453976 0.5479606 0.5012502 3.501133 55.71589 1.09224559 1.09224559
## 42 0.47150751 0.6876126 0.5795601 5.449680 65.03770 0.00883483 0.48357033
## 43 3.92274373 6.8888011 5.4057724 21.720788 62.13403 0.05518050 0.18156856
## 44 4.56728528 7.6391664 6.1032258 20.034625 62.00891 0.66987244 1.22338396
## 45 0.38531522 0.6817970 0.5335561 3.563907 59.41022 0.02119275 0.08224764
## 46 0.24379309 0.2753184 0.2595557 2.589981 53.14127 0.02280102 2.25306522
## 47 2.51953653 4.8459528 3.6827447 14.865491 65.33927 0.03731000 0.65275202
## 48 5.07035282 8.1838074 6.6270801 21.461962 64.91701 0.82927922 2.37370970
## 49 0.27996116 0.3732648 0.3266130 3.068898 59.33504 0.29767108 1.30821429
## 50 6.13905854 8.3967659 7.2679122 21.655272 64.27348 0.10727668 0.83224732
## 51 0.93517499 1.1745195 1.0548473 4.812073 60.75253 0.17247807 1.60953779
## 52 0.25836523 0.3807578 0.3195615 2.926022 53.22380 0.12414318 0.50522212
## 53 1.07800787 1.4664646 1.2722362 6.450271 65.33518 0.00779004 0.03957348
## 54 0.68159397 0.9736716 0.8276328 4.949404 61.80835 0.11123176 4.03598549
## 55 0.85537137 1.2034197 1.0293956 4.690618 63.56850 0.09587522 0.85687032
## 56 2.66613364 5.8764855 4.2713096 19.157725 66.43028 0.09768785 1.07906606
## 57 0.26534733 0.3608357 0.3130915 2.480519 50.39318 0.15477751 0.12291734
## 58 1.98522693 3.4164040 2.7008155 11.529802 68.71630 0.18729160 0.25189446
## 59 1.39566195 2.1799124 1.7877871 10.920884 71.20211 13.92730000 1.48348833
## 60 0.81547194 1.0741411 0.9448065 6.179956 66.76674 13.52617328 4.54938073
## 61 0.63862200 1.0737409 0.8561815 5.857166 67.59164 2.67663435 1.47752190
## 62 1.27963767 0.9669791 1.1233084 6.184574 69.33887 0.81800269 0.50222420
## 63 0.37591930 0.5902882 0.4831038 3.323600 58.28983 0.38433600 0.88530570
## 64 2.50008058 3.5376243 3.0188525 13.865802 64.72778 0.04853506 0.70452983
## 65 2.41256950 3.6798039 3.0461867 11.976986 60.09777 0.08883800 4.10526802
## 66 5.48160915 8.8652623 7.1734357 22.751680 63.91920 0.60431283 2.05450748
## 67 1.93886184 2.1524976 2.0456797 8.796643 67.45326 0.02934855 2.70993075
## 68 6.16625352 10.5564415 8.3613475 27.576370 59.72678 1.26529100 3.47073458
## 69 0.53354023 0.6712123 0.6023762 3.846490 61.90802 0.09956011 1.12142498
## 70 0.91633260 2.0700761 1.4932044 7.391846 64.14760 0.18276499 0.06769826
## 71 0.19255206 0.3472758 0.2699139 2.339187 57.87865 0.51393010 0.90299417
## 72 0.20842979 0.2570540 0.2327419 2.550472 75.91064 0.04137309 2.32172222
## 73 3.14242031 7.9881716 5.5652960 20.043620 63.96060 0.01926542 0.30983307
## 74 1.19514163 1.7705697 1.4828557 7.002368 66.90176 0.06848925 6.69494135
## 75 0.37851920 1.2632823 0.8209008 4.901087 62.38256 0.02108132 0.69437813
## 76 0.33809045 0.4611975 0.3996440 3.253432 55.62158 0.04818977 0.50030907
## 77 0.62399259 0.8970569 0.7605248 4.392040 67.28872 0.06678567 0.03795632
## 78 3.50274874 8.1713074 5.8370281 19.705033 65.41254 0.02789533 0.44531351
## 79 3.00125285 5.0458011 4.0235270 14.183154 69.93802 0.00607728 2.50093827
## 80 0.38401050 0.4643295 0.4241700 2.986717 56.34513 0.26262368 0.45139856
## 81 0.20543741 0.4120391 0.3087382 2.645435 53.45228 0.18143315 1.92440762
## 82 1.01429906 1.1340407 1.0741699 6.671755 69.33310 0.31528585 0.95962821
## 83 0.24060395 0.2961390 0.2683715 2.507230 49.94928 0.19077690 0.15635016
## 84 0.32220470 0.5186323 0.4204185 3.141112 56.77571 0.04403319 0.04272164
## 85 1.45222816 2.5933641 2.0227961 11.474173 70.73213 0.01265303 6.23301970
## 86 1.32388392 1.7807238 1.5523039 7.223685 66.21947 1.26190788 0.64914626
## 87 1.43488921 3.0996156 2.2672524 11.469556 72.67035 0.03545883 1.23519804
## 88 0.44312835 0.8136545 0.6283914 4.083539 65.50689 0.03170208 0.02040609
## 89 2.64987500 4.1910961 3.4204855 14.974937 66.81554 0.00622345 0.46271004
## 90 0.89534738 1.4420998 1.1687236 7.012905 65.78072 0.36029138 0.80728519
## 91 0.22502107 0.4712336 0.3481273 2.890764 52.43844 0.29495962 0.37508535
## 92 0.57207835 0.9861366 0.7791075 5.784642 67.84431 0.53708395 0.82238615
## 93 0.40544266 0.8249161 0.6151794 3.636032 59.45372 0.02448255 0.02973746
## 94 0.73815416 0.7650848 0.7516195 5.727671 63.85806 0.28087871 1.95939107
## 95 3.64646480 5.7488137 4.6976392 19.196193 64.69565 0.17231017 5.11457910
## 96 3.17823477 4.2839926 3.7311137 15.652425 64.69414 0.04885500 0.18554176
## 97 0.87536492 1.3297727 1.1025688 5.247497 64.55082 0.06465513 0.53727048
## 98 0.20098806 0.2671884 0.2340882 2.595008 47.42067 0.22442948 0.17717651
## 99 3.20399502 5.2423112 4.2231531 17.049222 65.40174 0.05314336 0.14554920
## 100 0.29164290 0.6276245 0.4596337 2.392787 75.36071 0.04829483 0.15604145
## 101 0.66816849 0.6409555 0.6545620 4.312774 60.41741 2.12215030 2.75289319
## 102 1.69079701 2.1502704 1.9205337 8.104731 64.83296 0.04176873 0.56186077
## 103 1.01873059 1.4083568 1.2135437 6.430215 64.12928 0.06956071 0.17508359
## 104 1.46155999 1.9002429 1.6809015 8.088393 66.12100 0.31989256 0.24991606
## 105 0.52949911 1.0492596 0.7893793 5.122569 63.91439 1.06651922 3.57688305
## 106 2.90312619 6.0231067 4.4631164 17.517817 67.42991 0.37978548 1.24035886
## 107 4.92825496 7.7534849 6.3408699 21.953858 64.58823 0.10281762 1.12239454
## 108 0.08736843 0.2820742 0.1847213 1.370070 85.08917 0.02781677 2.39593196
## 109 3.42296861 5.9939190 4.7084438 18.338701 66.12674 0.19473936 0.84639847
## 110 0.28365324 0.4412880 0.3624706 2.938196 57.08623 0.12301939 4.98659870
## 111 2.20804973 2.6884001 2.4482249 9.589787 67.86891 0.00110210 2.82589744
## 112 0.39373448 0.6139561 0.5038453 3.314088 71.64306 0.33699947 0.15676654
## 113 0.31785259 0.4472135 0.3825330 3.086824 53.85775 0.15854360 0.82347478
## 114 3.14271267 4.8955145 4.0191136 18.345793 65.96453 0.06982084 0.79831740
## 115 0.27619394 0.4282340 0.3522140 2.966556 55.97380 0.07650154 1.05987171
## 116 1.57583078 2.7774882 2.1766595 11.463380 76.25834 0.05638676 79.52998418
## 117 2.06381766 4.3809082 3.2223629 15.629247 68.92462 0.05447011 1.13290578
## 118 3.49460207 7.1359265 5.3152643 19.606880 65.37135 0.02067372 1.02639860
## 119 0.46387285 0.9730718 0.7184723 5.318005 65.60251 0.57779622 0.47630120
## 120 2.07437980 4.3497052 3.2120425 14.418556 72.60812 0.51635256 5.29652104
## 121 4.67746877 7.6569426 6.1672057 19.378508 65.95449 0.46723749 0.93529058
## 122 1.29445871 1.9186975 1.6065781 10.473220 65.32978 0.21670000 3.45558922
## 123 4.08274767 6.2624588 5.1726032 20.095525 62.32269 0.10183175 0.25001043
## 124 3.98029809 6.3184688 5.1493834 18.623217 66.46583 0.08516543 2.15521378
## 125 0.44981821 0.5970683 0.5234433 3.021888 60.19383 0.09100837 0.65572714
## 126 2.07568057 2.9874503 2.5315654 11.900893 71.01212 0.69428524 1.35897207
## 127 0.23607069 0.3039569 0.2700138 2.869468 55.79601 0.07889094 1.45046773
## 128 1.43186270 2.0076257 1.7197442 8.315679 67.51420 0.11565204 0.74441323
## 129 1.25823610 2.0967233 1.6774797 8.483213 66.86738 0.82319724 1.06960129
## 130 0.13547819 0.2760308 0.2057545 1.940987 51.12849 0.42723139 2.13061734
## 131 2.37050281 5.6047403 3.9876216 16.434686 67.75290 0.44622516 0.77029667
## 132 0.09768939 0.1638645 0.1307769 1.085001 84.31149 0.09630959 1.35609110
## 133 4.13800199 5.9184161 5.0282090 18.395866 63.92605 0.66488991 2.74827392
## 134 3.10021646 4.6499908 3.8751036 15.807654 65.48331 3.27167434 0.35766089
## 135 2.71338358 6.0761446 4.3947641 14.814520 64.57750 0.03449299 0.19708028
## 136 0.62822093 1.0455867 0.8369038 4.419138 66.89480 0.32955400 0.77469205
## 137 0.28362786 0.4161354 0.3498816 2.876270 57.50884 0.28498687 0.53977853
## 138 0.15468651 0.3512552 0.2529708 2.099678 52.96418 0.17351822 0.23341479
## 139 0.24497323 0.5995746 0.4222739 2.939524 54.65941 0.14439018 0.37324591
## Mujeres Urbano ExpectVida NeontlMort DisMort Lesion EnfNoTrans
## 1 48.63585 25.495 62.701 37.1 29.8 19.5 44.1
## 2 49.06309 60.319 76.601 6.5 17.0 4.0 93.1
## 3 49.48427 72.629 75.307 14.6 14.2 9.5 75.7
## 4 50.53046 65.514 57.677 28.5 16.5 9.2 27.4
## 5 51.23735 91.870 72.924 6.4 15.8 6.5 77.6
## 6 52.95658 63.149 71.115 6.5 22.3 3.9 93.3
## 7 50.19962 86.012 80.400 2.3 9.1 5.9 89.5
## 8 50.82943 58.297 79.300 2.1 11.4 5.2 92.2
## 9 50.11575 55.680 70.128 11.2 22.2 4.6 86.6
## 10 49.38730 36.632 70.409 17.1 21.6 7.5 66.9
## 11 53.45605 78.595 69.300 1.3 23.7 7.0 90.5
## 12 50.59332 98.001 79.000 2.0 11.4 6.4 85.7
## 13 50.19252 45.724 71.533 8.6 22.1 13.2 67.4
## 14 50.09820 47.312 59.633 31.3 19.6 10.2 35.7
## 15 47.00264 40.895 70.822 16.4 23.3 10.5 68.6
## 16 49.78340 69.425 68.173 14.3 17.2 13.1 64.5
## 17 51.01054 48.245 74.622 4.1 17.8 3.7 94.5
## 18 51.73076 69.446 65.790 24.5 20.3 8.3 45.7
## 19 50.82992 86.569 71.804 8.1 16.6 12.2 73.9
## 20 48.03618 77.629 74.454 5.5 16.6 7.4 84.8
## 21 51.41409 75.008 71.300 3.6 23.6 2.6 95.2
## 22 50.09548 29.358 59.981 24.7 21.7 11.0 32.7
## 23 50.42199 13.032 59.092 21.7 22.9 12.1 32.1
## 24 51.19798 23.388 67.062 14.4 21.1 10.0 64.4
## 25 50.00349 56.374 57.235 26.6 21.6 10.9 35.2
## 26 50.39153 81.411 80.288 3.4 9.8 6.1 88.3
## 27 50.43647 41.364 50.152 41.2 23.1 10.3 26.0
## 28 50.92577 80.778 74.124 7.8 15.8 15.0 74.8
## 29 49.55870 28.965 62.210 31.6 22.9 10.9 41.7
## 30 50.06560 66.916 62.546 20.3 16.7 9.9 34.6
## 31 51.85262 56.947 74.900 2.6 16.7 5.3 92.4
## 32 50.80859 73.792 76.500 1.8 15.0 4.7 89.9
## 33 50.27420 87.874 79.200 3.1 11.3 3.8 89.7
## 34 47.36679 77.777 64.000 31.7 19.6 10.4 44.4
## 35 50.00780 81.074 70.609 19.4 19.0 12.0 72.3
## 36 49.97063 63.821 73.833 7.2 13.0 12.8 72.2
## 37 49.46997 42.704 69.453 11.2 27.7 5.8 84.1
## 38 53.11400 72.023 68.006 6.7 14.0 15.4 73.8
## 39 44.45585 72.143 57.059 29.9 22.0 10.7 35.9
## 40 52.85843 68.880 73.300 1.2 17.0 4.5 92.7
## 41 49.97889 20.763 63.997 28.1 18.3 11.7 39.3
## 42 49.30050 56.248 65.594 10.9 30.6 5.4 84.4
## 43 50.72076 85.382 78.600 1.0 10.2 5.5 93.2
## 44 51.58424 80.444 79.500 2.5 10.6 6.4 87.6
## 45 49.06862 89.370 63.879 21.0 14.4 9.1 41.0
## 46 50.40213 61.270 60.088 26.3 20.4 10.9 34.3
## 47 52.29124 58.632 68.980 5.9 24.9 3.6 93.7
## 48 50.66037 77.312 78.600 2.2 12.1 4.0 91.2
## 49 49.32583 56.060 62.437 23.9 20.8 9.8 42.7
## 50 50.91620 79.058 78.900 2.6 12.4 2.9 86.2
## 51 50.75935 51.054 70.830 12.3 14.9 15.7 59.2
## 52 51.82111 36.140 60.040 31.1 22.4 9.2 35.1
## 53 49.80802 26.606 66.605 18.2 30.5 12.4 67.6
## 54 50.65221 55.278 61.139 26.0 26.5 12.6 57.1
## 55 50.04934 57.096 72.573 9.6 14.0 19.6 66.5
## 56 52.43243 71.351 72.600 2.3 23.0 4.4 93.8
## 57 50.08490 23.059 52.315 34.2 23.9 9.3 27.3
## 58 50.72703 87.564 77.333 4.9 12.4 7.1 84.7
## 59 48.67937 59.152 74.315 4.3 17.0 7.0 89.3
## 60 48.02354 34.030 68.000 22.7 23.3 11.3 62.7
## 61 49.64388 55.325 69.156 12.7 26.4 6.0 73.3
## 62 49.43913 74.898 75.217 8.9 14.8 10.1 81.9
## 63 49.40868 70.473 68.277 15.3 21.3 28.4 54.7
## 64 50.42551 63.170 80.200 2.3 10.3 4.3 90.6
## 65 50.29813 92.418 80.700 1.9 9.6 4.1 85.8
## 66 51.37667 70.438 81.000 2.0 9.5 3.8 91.4
## 67 50.33983 55.674 72.708 10.2 14.7 8.7 80.0
## 68 51.15926 91.616 81.090 0.9 8.4 4.8 82.4
## 69 49.38968 90.979 72.628 9.5 19.2 10.9 78.4
## 70 51.51148 57.428 68.720 5.6 26.8 9.5 86.0
## 71 50.31602 27.030 63.539 19.6 13.4 9.6 27.1
## 72 39.54817 100.000 74.584 4.5 17.4 12.8 72.4
## 73 54.01017 68.142 69.900 2.0 21.9 5.4 91.8
## 74 49.70581 88.593 77.031 4.3 17.9 5.8 90.6
## 75 50.71690 28.153 49.837 34.9 26.6 8.3 32.3
## 76 49.76829 51.151 61.911 24.5 17.6 10.0 31.4
## 77 49.48379 80.102 69.672 6.4 20.1 20.1 71.9
## 78 53.79196 67.679 69.500 2.1 20.7 6.6 89.8
## 79 49.53926 90.981 80.100 1.4 10.0 6.7 88.4
## 80 50.12397 37.191 64.728 20.6 22.9 10.6 43.2
## 81 50.70152 16.937 60.155 22.4 16.4 8.6 31.7
## 82 48.57852 76.036 73.903 4.3 17.2 8.9 73.6
## 83 49.94100 42.356 57.718 32.7 24.6 8.9 30.5
## 84 49.82266 53.672 62.831 33.5 18.1 9.4 37.2
## 85 50.57711 40.793 71.300 9.2 22.6 4.8 88.7
## 86 51.08928 80.156 72.046 7.5 15.7 10.3 79.9
## 87 52.03556 42.629 67.439 11.9 24.9 5.7 90.1
## 88 50.66954 68.445 65.465 8.7 30.2 10.6 79.7
## 89 50.55901 66.813 74.205 1.7 20.6 3.5 95.0
## 90 50.40385 62.453 74.948 13.8 12.4 6.4 79.6
## 91 51.47519 35.988 56.293 27.8 18.4 7.8 26.9
## 92 51.80790 30.579 63.419 23.1 24.2 8.6 67.8
## 93 51.55369 50.032 60.020 15.6 21.3 9.8 40.9
## 94 54.53534 19.740 68.710 19.9 21.8 8.8 66.2
## 95 50.22094 91.490 80.000 2.1 11.2 5.2 89.6
## 96 50.83777 86.538 80.000 3.5 10.1 6.0 89.5
## 97 50.71271 58.522 70.551 9.4 14.2 12.7 76.4
## 98 49.77100 16.425 60.485 25.2 20.0 10.4 27.0
## 99 49.52463 82.248 80.900 1.5 9.2 5.6 87.0
## 100 34.01408 84.539 75.645 5.1 17.8 17.7 71.9
## 101 48.53807 36.666 66.041 42.0 24.7 7.3 57.8
## 102 49.90538 67.709 75.060 8.5 13.0 9.7 74.6
## 103 49.15161 61.585 72.041 10.7 17.5 12.0 74.4
## 104 50.33776 77.907 73.612 7.3 12.6 10.5 69.2
## 105 49.74166 46.907 66.971 13.5 26.8 7.5 67.3
## 106 51.53071 60.058 73.900 2.7 18.7 4.7 90.3
## 107 52.71196 65.211 78.100 2.1 11.1 4.2 85.6
## 108 24.49529 99.135 78.830 3.5 15.3 25.9 68.9
## 109 51.34374 53.998 71.700 3.4 21.4 3.6 92.2
## 110 50.86106 17.211 66.187 15.9 18.2 13.5 44.0
## 111 49.20878 52.198 70.075 9.7 23.2 5.6 81.0
## 112 42.44585 83.844 73.671 3.7 16.4 16.3 73.2
## 113 51.27733 47.192 65.242 20.6 18.1 12.2 42.1
## 114 51.00252 56.092 73.600 3.4 19.1 3.0 94.6
## 115 50.12127 42.055 53.049 32.8 30.5 8.9 33.2
## 116 47.65813 100.000 80.700 1.1 9.3 3.7 73.6
## 117 51.33833 53.726 73.800 2.8 17.2 6.0 89.2
## 118 50.24521 54.541 78.200 1.2 12.7 6.6 88.4
## 119 50.69415 66.355 60.162 10.7 26.2 9.1 51.3
## 120 49.91688 81.459 79.700 1.5 7.8 10.0 79.8
## 121 50.89664 80.321 80.500 1.7 9.9 3.5 91.4
## 122 51.96682 18.476 73.238 4.5 17.4 9.7 82.8
## 123 49.94578 87.431 80.600 1.5 9.1 4.9 89.9
## 124 50.42712 73.797 81.700 2.9 8.6 6.1 89.6
## 125 49.58384 27.134 68.493 15.0 25.3 7.6 69.2
## 126 51.26870 49.949 72.977 5.0 14.5 10.2 74.0
## 127 50.26805 41.702 59.644 24.9 23.6 10.7 37.6
## 128 50.43715 68.945 74.297 11.5 16.1 6.4 85.8
## 129 50.67781 75.143 74.149 5.5 16.1 6.2 89.4
## 130 50.77608 23.774 60.270 19.9 21.9 12.7 32.9
## 131 53.68775 69.352 67.020 5.2 24.7 5.0 91.0
## 132 30.63669 86.522 76.966 4.0 16.8 16.8 76.8
## 133 50.63527 83.398 79.400 2.6 10.9 3.5 88.8
## 134 50.52001 82.256 76.100 3.5 14.6 6.6 88.3
## 135 51.72154 95.334 73.805 4.5 16.7 7.5 84.9
## 136 50.13736 50.478 69.250 11.6 24.5 6.0 83.7
## 137 49.61166 36.642 64.413 27.0 30.6 14.7 56.6
## 138 50.49321 43.521 60.158 23.5 17.9 10.2 29.2
## 139 52.35675 32.209 59.105 20.9 19.3 12.3 33.0
## Tuberculosis Diabetes ImmunSaramp HipTen.H HipTen.M BCG Medicos
## 1 189.0 9.2 64 18.6 19.8 1 0.24009091
## 2 18.0 9.0 94 41.6 39.4 1 1.21237143
## 3 69.0 6.7 80 22.3 23.0 1 1.31202500
## 4 355.0 4.5 50 31.1 25.2 1 0.17300000
## 5 27.0 5.9 94 41.8 32.9 1 3.57165000
## 6 31.0 6.1 95 41.2 43.4 1 3.06122500
## 7 6.6 5.6 95 34.8 32.8 1 3.27402222
## 8 7.1 6.6 94 44.9 38.8 1 4.66801111
## 9 63.0 6.1 96 25.9 31.4 1 3.58736250
## 10 221.0 9.2 97 15.2 17.4 1 0.39047692
## 11 31.0 5.0 97 43.9 45.5 1 4.22154000
## 12 9.0 4.6 96 39.4 35.0 0 2.79814444
## 13 30.0 17.1 97 24.3 25.1 1 0.96785000
## 14 56.0 1.0 71 39.9 40.3 1 0.11874000
## 15 149.0 10.3 97 19.7 20.4 1 0.26431111
## 16 108.0 6.8 89 27.4 27.2 1 0.71612500
## 17 25.0 9.0 68 45.6 43.2 1 1.77503333
## 18 275.0 5.8 97 42.2 41.0 1 0.35774444
## 19 45.0 10.4 84 28.1 38.5 1 1.84654000
## 20 68.0 13.3 99 29.1 32.0 1 1.38302727
## 21 22.0 6.0 93 45.5 46.5 1 3.80887500
## 22 48.0 7.3 88 9.0 12.4 1 0.04237143
## 23 111.0 5.1 88 32.6 30.8 1 0.04885000
## 24 302.0 6.4 84 25.5 24.1 1 0.24971429
## 25 186.0 6.0 71 18.5 17.9 1 0.07534000
## 26 5.6 7.6 90 22.7 23.9 0 2.32944444
## 27 540.0 6.0 49 33.6 33.2 1 0.04973333
## 28 33.0 7.4 95 28.7 28.7 1 1.70129231
## 29 35.0 12.3 90 43.6 41.5 1 0.18323333
## 30 375.0 6.0 75 18.2 19.3 1 0.12880000
## 31 8.4 5.4 93 43.7 38.5 1 2.80697000
## 32 5.4 7.0 96 48.2 42.6 1 3.70292500
## 33 5.4 8.3 95 39.9 34.6 1 3.56958333
## 34 260.0 5.1 86 19.8 22.3 1 0.21512500
## 35 45.0 8.6 95 27.4 29.3 1 1.37733333
## 36 44.0 5.5 83 28.5 28.6 1 1.90360000
## 37 12.0 17.2 94 17.1 23.9 1 1.73048750
## 38 70.0 8.8 81 27.1 30.0 1 1.65428000
## 39 201.0 6.0 30 28.2 25.2 1 0.40000000
## 40 13.0 4.2 87 45.5 42.9 1 3.34070000
## 41 151.0 4.3 61 27.5 22.2 1 0.03620000
## 42 54.0 14.7 94 27.6 25.0 1 0.58042000
## 43 4.7 5.6 96 54.6 46.6 1 3.14394000
## 44 8.9 4.8 90 38.0 38.5 1 3.26508571
## 45 525.0 6.0 59 44.7 43.6 1 0.36110000
## 46 174.0 1.9 91 33.0 30.4 1 0.09858333
## 47 80.0 5.8 98 40.2 41.0 1 4.62520000
## 48 7.3 10.4 97 35.6 34.2 1 3.84022000
## 49 148.0 2.5 92 41.5 41.4 1 0.12015714
## 50 4.5 4.7 97 39.2 36.4 1 5.71011111
## 51 26.0 10.0 87 25.6 26.5 1 0.62945000
## 52 176.0 2.4 48 40.6 41.0 1 0.09196667
## 53 83.0 11.6 98 26.2 26.3 1 0.56823333
## 54 176.0 6.7 69 25.5 26.7 1 0.18585000
## 55 37.0 7.3 89 25.5 25.7 1 0.57160000
## 56 6.4 6.9 99 46.2 47.4 1 3.24861667
## 57 142.0 6.0 37 32.7 31.3 1 0.04200000
## 58 18.0 8.6 93 31.7 28.2 1 1.03645000
## 59 61.0 9.2 99 35.7 32.3 1 1.57320000
## 60 199.0 10.4 90 25.8 29.2 1 0.67390833
## 61 316.0 6.3 75 25.0 24.7 1 0.24655000
## 62 14.0 9.6 99 26.4 25.9 1 0.98516000
## 63 42.0 8.8 83 24.8 23.9 1 0.72533333
## 64 7.0 3.2 92 46.0 32.2 1 2.81283000
## 65 4.0 9.7 98 33.8 40.1 1 3.38105556
## 66 7.0 5.0 93 45.7 36.5 0 3.94927778
## 67 2.9 11.3 89 30.4 33.6 1 0.54227143
## 68 14.0 5.6 97 46.7 37.5 1 2.27806667
## 69 5.0 12.7 92 29.3 26.3 1 2.24923636
## 70 68.0 6.1 99 33.9 33.1 1 3.60587000
## 71 292.0 3.1 89 34.7 36.8 1 0.18122857
## 72 23.0 12.2 99 24.5 26.5 1 2.16873636
## 73 29.0 5.0 98 44.7 36.7 1 3.38225000
## 74 11.0 11.2 82 30.6 29.6 0 2.55344444
## 75 611.0 4.5 90 17.5 35.0 1 0.06760000
## 76 308.0 2.4 91 39.9 40.3 1 0.02466667
## 77 40.0 10.2 97 23.4 23.6 1 1.98748333
## 78 44.0 3.8 92 43.5 40.5 1 4.08613000
## 79 8.0 5.0 99 48.5 37.1 1 2.85313000
## 80 233.0 4.5 62 33.1 32.2 1 0.17360000
## 81 181.0 4.5 87 33.4 32.6 1 0.01767500
## 82 92.0 16.7 96 26.5 25.2 1 1.24358000
## 83 53.0 2.4 70 32.6 32.1 1 0.09575714
## 84 93.0 7.1 78 26.3 29.5 1 0.14066667
## 85 13.0 22.0 99 49.0 48.4 1 1.45775556
## 86 23.0 13.5 97 29.3 28.5 1 2.03156667
## 87 86.0 5.7 93 43.3 42.2 1 2.62560000
## 88 428.0 4.7 99 37.3 30.6 1 2.96358889
## 89 15.0 9.0 58 43.4 41.9 1 2.08927778
## 90 99.0 7.0 99 33.5 33.0 1 0.63655000
## 91 551.0 3.3 85 36.1 31.5 1 0.04688750
## 92 338.0 3.9 93 24.7 25.5 1 0.53712000
## 93 524.0 4.5 82 43.2 41.9 1 0.37305000
## 94 151.0 7.2 91 21.6 22.1 1 0.57297500
## 95 5.3 5.4 93 39.1 33.8 0 3.40828889
## 96 7.3 6.2 92 36.4 30.9 1 2.70726000
## 97 41.0 11.4 99 25.4 26.2 1 0.74390000
## 98 87.0 2.4 77 33.8 32.4 1 0.03340000
## 99 4.1 5.3 96 38.2 33.0 1 4.21626667
## 100 5.9 10.1 99 22.2 26.2 1 1.95183077
## 101 265.0 19.9 76 20.1 21.1 1 0.84727500
## 102 52.0 7.7 98 27.7 24.6 1 1.43397000
## 103 43.0 9.6 93 27.8 27.2 1 0.96393333
## 104 123.0 6.6 85 16.2 17.8 1 1.18280000
## 105 554.0 7.1 67 28.0 23.5 1 1.25186667
## 106 16.0 6.1 93 40.9 35.0 1 2.19399000
## 107 24.0 9.8 99 38.6 35.7 1 3.79097273
## 108 31.0 15.6 99 26.8 36.2 1 2.47302500
## 109 68.0 6.9 90 39.1 46.7 1 2.40146667
## 110 59.0 5.1 99 32.2 30.4 1 0.09168889
## 111 6.3 11.6 99 27.9 30.7 1 0.65870000
## 112 10.0 15.8 98 25.6 27.0 1 2.25626250
## 113 118.0 2.4 82 42.3 40.4 1 0.14020000
## 114 17.0 9.0 92 43.5 41.6 1 2.42901111
## 115 298.0 2.4 80 39.8 39.7 1 0.02050000
## 116 47.0 5.5 95 25.7 22.1 1 1.76859091
## 117 5.8 6.5 96 39.5 33.7 1 3.11790000
## 118 5.3 5.9 93 42.5 37.2 1 2.59476000
## 119 520.0 12.7 70 47.0 45.9 1 0.76988750
## 120 66.0 6.9 98 28.6 23.5 1 2.05984615
## 121 9.4 6.9 97 44.0 37.1 1 4.15920000
## 122 64.0 10.7 99 23.0 25.8 1 0.77147000
## 123 5.5 4.8 97 41.8 37.0 0 4.03310000
## 124 6.4 5.7 96 38.6 31.7 1 4.00455000
## 125 84.0 6.1 98 26.3 25.4 1 1.78443333
## 126 153.0 7.0 96 23.4 23.8 1 0.40473333
## 127 36.0 2.4 85 39.5 40.1 1 0.08897500
## 128 35.0 8.5 96 20.9 25.2 1 1.16097143
## 129 16.0 11.1 96 38.3 35.1 1 1.65210000
## 130 200.0 2.5 86 24.6 32.7 1 0.10457500
## 131 80.0 6.1 91 47.7 50.6 1 3.35196667
## 132 1.0 16.3 99 17.9 19.2 1 1.70489167
## 133 8.0 3.9 92 31.7 29.9 1 2.75287500
## 134 3.0 10.8 92 31.1 31.8 0 2.52747500
## 135 33.0 7.3 97 37.5 38.8 1 4.16766000
## 136 70.0 6.5 96 27.1 27.7 1 2.50781250
## 137 48.0 5.4 64 9.6 12.4 1 0.30986667
## 138 346.0 4.5 94 27.2 27.4 1 0.08791250
## 139 210.0 1.8 88 33.2 32.0 1 0.06561250
## Camas PBI TempMarzo l10muertes.permil muertes.permil
## 1 0.4363636 1.8351696 7.60 0.85166698 6.10668360
## 2 2.9375000 11.3351950 6.04 1.09735434 11.51279525
## 3 1.9000000 14.1967389 17.91 1.19736588 14.75309441
## 4 0.8000000 6.7205961 22.78 0.05301271 0.12982898
## 5 4.6000000 20.0684923 17.51 1.08768715 11.23734344
## 6 4.0200000 8.3491802 -0.57 1.53403057 33.20035125
## 7 3.8783333 45.7525548 25.37 0.70937665 4.12125797
## 8 7.7000000 48.9687140 1.42 1.86867832 72.90576495
## 9 6.4666667 17.0906963 4.97 0.80830014 5.43132025
## 10 0.5750000 3.3061083 25.42 0.64062316 3.37142634
## 11 11.2000000 18.1721809 -0.69 1.37219412 22.56102177
## 12 6.5500000 45.2631622 5.23 2.91424609 819.81651659
## 13 1.1600000 8.0937796 24.45 0.79385771 5.22096426
## 14 0.5000000 2.0675705 30.14 0.10078712 0.26120918
## 15 1.7333333 8.3417246 5.68 0.00000000 0.00000000
## 16 1.1000000 6.5317860 22.07 1.40930364 24.66277617
## 17 3.3666667 11.6971771 4.01 1.66678153 45.42816649
## 18 2.0000000 16.1336867 24.30 0.15945618 0.44363092
## 19 2.3285714 15.5847506 25.49 2.09062497 122.20404597
## 20 2.7542857 80.8004129 25.92 0.75300190 4.66241765
## 21 6.4888889 17.9465777 4.70 1.29960529 18.93449746
## 22 0.6500000 1.6709928 30.63 0.56624131 2.68333575
## 23 1.1333333 0.7568378 20.43 0.03722023 0.08948243
## 24 0.7600000 3.3333517 27.93 0.00000000 0.00000000
## 25 1.4000000 3.2930885 26.27 0.90413575 7.01928682
## 26 3.0714286 44.2264907 -18.72 2.26374838 182.54745910
## 27 1.1000000 0.8532664 26.96 0.08432564 0.21429902
## 28 1.3166667 13.2116325 25.14 1.23486238 16.17364085
## 29 2.2000000 2.6420144 25.20 0.53185125 2.40291618
## 30 1.6000000 5.6636489 25.60 0.66491803 3.62293762
## 31 5.6354545 22.9922117 5.83 1.40989932 24.69799971
## 32 7.0100000 32.7718057 2.80 1.48902061 29.83334267
## 33 3.4111111 48.5249925 2.24 1.99324531 97.45670766
## 34 1.4571429 2.7442687 25.75 1.29603122 18.77111751
## 35 1.4375000 13.9050879 22.88 1.65899033 44.60267625
## 36 1.5285714 10.8759023 21.93 2.28487232 191.69583028
## 37 1.5100000 10.8110341 17.83 0.96804820 8.29069493
## 38 0.9900000 7.2348467 25.70 0.84966889 6.07406245
## 39 2.0666667 30.5908474 25.04 1.00721356 9.16748537
## 40 5.3600000 28.8340001 -2.35 1.70728513 49.96653756
## 41 1.7500000 1.5126247 23.48 0.02322475 0.05493270
## 42 2.1475000 8.8754441 25.00 0.00000000 0.00000000
## 43 5.9600000 42.8552430 -6.09 1.76134842 56.72293654
## 44 6.9222222 40.3515680 6.37 2.63132934 426.88724438
## 45 3.2000000 17.0778163 26.14 0.88115819 6.60603272
## 46 1.0000000 2.4051919 27.32 0.15793307 0.43857687
## 47 3.1222222 9.5834608 0.72 0.62493108 3.21629590
## 48 8.2555556 46.5762068 3.87 2.01040779 101.42542822
## 49 0.9000000 3.9219764 29.52 0.33086008 1.14220031
## 50 4.6555556 27.2065489 8.19 1.23366924 16.12652442
## 51 0.6250000 7.5159291 22.94 0.69394933 3.94253020
## 52 0.3000000 2.0022876 27.63 0.43000974 1.69159514
## 53 2.1600000 7.1987245 25.65 1.17956888 14.12059502
## 54 1.0000000 1.7058976 23.47 0.60817085 3.05668093
## 55 0.7285714 4.4336960 23.38 1.32704478 20.23463414
## 56 7.3000000 25.7573736 5.44 1.72513328 52.10473974
## 57 0.4000000 2.0073216 26.55 0.71053771 4.13496767
## 58 2.1714286 22.2523960 10.87 1.66184336 44.90324179
## 59 3.4066667 13.5313781 0.49 0.63650295 3.33015014
## 60 0.8000000 5.8366566 23.45 0.63846947 3.34980183
## 61 0.9000000 10.5772045 25.79 0.81312576 5.50317977
## 62 1.4400000 18.4501839 11.33 1.97066822 92.46913357
## 63 1.3100000 15.8895142 15.12 0.74455172 4.55330752
## 64 3.9555556 59.3055780 6.00 2.52768884 336.04573683
## 65 3.5333333 34.5710854 14.96 1.51362517 31.63060852
## 66 3.6875000 37.7630816 6.52 2.73899149 547.26622303
## 67 1.7571429 8.5085469 23.44 0.60923050 3.06659102
## 68 13.7960000 39.1530060 2.52 0.89103814 6.78104879
## 69 1.7818182 9.2014965 13.08 0.27966158 0.90397650
## 70 7.4111111 24.1030338 -3.96 0.48064752 2.02445775
## 71 1.4000000 2.8839337 26.10 0.31600904 1.07018445
## 72 1.9800000 75.8307296 19.23 1.63646809 42.29802512
## 73 6.8111111 23.8146826 -1.37 1.11188355 11.93848875
## 74 3.3800000 13.2450688 10.39 0.68089875 3.79621619
## 75 1.3000000 2.9043623 15.13 0.00000000 0.00000000
## 76 0.7500000 1.2563111 26.44 0.81973136 5.60284890
## 77 3.6700000 19.3396159 17.76 0.20382969 0.59893088
## 78 7.1666667 27.8087523 -0.47 1.39199086 23.65987425
## 79 5.3727273 100.2191161 4.70 2.26007623 181.00202722
## 80 0.2500000 1.7044431 23.99 0.03187466 0.07615460
## 81 1.2000000 1.1836484 23.25 0.08652600 0.22046688
## 82 1.8312500 25.8714034 25.19 0.66721788 3.64748370
## 83 0.3333333 2.0131236 27.34 0.66924316 3.66920733
## 84 0.4000000 3.8172107 25.29 0.66592067 3.63362273
## 85 3.2333333 19.3987280 25.48 0.94954834 7.90324531
## 86 1.5888889 17.8555895 18.44 1.83964772 68.12700147
## 87 6.1666667 5.8933274 2.93 1.89361039 77.27271317
## 88 6.3266667 11.1277975 -8.80 0.00000000 0.00000000
## 89 4.0125000 16.2734892 2.53 1.18924972 14.46143216
## 90 0.9800000 7.4795258 13.09 0.81997625 5.60657321
## 91 0.7666667 1.2616857 25.48 0.01447977 0.03390295
## 92 0.7500000 5.0214146 22.74 0.04599322 0.11171438
## 93 3.0000000 10.2230967 22.67 0.00000000 0.00000000
## 94 2.6500000 2.4752041 10.02 0.05782208 0.14241022
## 95 4.6000000 49.9843155 4.95 2.53367393 340.72277916
## 96 2.5500000 36.4995043 13.60 0.74060910 4.50312148
## 97 0.9222222 4.8837325 24.95 0.80708405 5.41333688
## 98 0.3000000 0.9278714 26.01 0.58564967 2.85167528
## 99 4.2555556 62.6503184 -5.49 1.65533067 44.22001168
## 100 1.8600000 42.4790524 23.40 0.94784219 7.86833705
## 101 0.7200000 4.6501098 16.01 0.84119511 5.93737399
## 102 2.2888889 20.8839055 25.44 1.88318015 75.41526879
## 103 1.2857143 11.4029323 25.84 0.41184731 1.58135246
## 104 1.4875000 12.3515166 19.99 2.09868025 124.51055442
## 105 0.5833333 7.0082665 25.13 0.97663292 8.47617167
## 106 6.5222222 25.9904310 2.65 1.44821011 27.06791213
## 107 3.4222222 29.3390041 11.33 2.12347272 131.88400976
## 108 1.6400000 123.2139364 21.78 1.07132447 10.78486107
## 109 6.4555556 21.6182719 3.40 1.80343313 62.59648794
## 110 1.6000000 1.7889788 19.25 0.00000000 0.00000000
## 111 3.3000000 10.9317631 25.90 0.00000000 0.00000000
## 112 2.2500000 51.5878305 20.60 1.13389947 12.61129580
## 113 0.2000000 3.1310271 28.47 0.53906244 2.45989116
## 114 5.6125000 14.9080484 4.91 1.54868038 34.37369129
## 115 0.4000000 1.4959394 27.65 0.83772947 5.88223453
## 116 2.7457143 86.0684237 28.62 0.70577580 4.07897173
## 117 6.3400000 29.0915206 2.40 0.78819906 5.14043390
## 118 4.6555556 31.7402860 3.38 1.72227622 51.75652955
## 119 2.8000000 12.8666891 21.10 1.02339821 9.55354121
## 120 10.6080000 34.6370853 3.66 0.79306494 5.20961879
## 121 3.1888889 34.5888453 8.60 2.76446761 580.39007101
## 122 3.5500000 11.1185327 27.03 0.16478915 0.46146747
## 123 2.7666667 47.6285919 -4.98 2.61847597 414.40906201
## 124 5.1222222 61.3146089 0.09 2.28867018 193.38832670
## 125 5.2666667 2.7293337 -3.08 0.78207686 5.05448015
## 126 2.1000000 15.8571484 27.38 0.26030714 0.82098822
## 127 0.8000000 1.4956789 29.31 0.42289247 1.64784448
## 128 2.0545455 11.2660561 14.21 0.71183934 4.15038075
## 129 2.4555556 23.5212137 4.77 1.73570816 53.41368734
## 130 0.7500000 1.8103287 23.68 0.00000000 0.00000000
## 131 8.9222222 8.4417522 1.18 1.18842716 14.43217590
## 132 1.6777778 65.5180899 22.61 1.43897112 26.47711407
## 133 3.2111111 41.1611271 4.66 2.75158819 563.40154117
## 134 3.0333333 55.0581658 0.06 2.48855760 307.00488362
## 135 2.5250000 20.4797528 21.26 0.86794498 6.37810755
## 136 4.5888889 6.8361061 5.38 0.15375896 0.42481657
## 137 0.6900000 3.5314239 20.82 0.45632576 1.85973480
## 138 1.9500000 3.8025013 22.90 0.14718638 0.40341585
## 139 2.3500000 2.5606953 22.92 0.10620013 0.27702715
El primer paso a la hora de establecer un modelo lineal múltiple es estudiar la relación que existe entre variables. Esta información es crítica a la hora de identificar cuáles pueden ser los mejores predictores para el modelo, y para detectar colinealidad entre predictores.
En primer lugar, se ajusta un modelo de regresión lineal (OLS) incluyendo todas las variables como predictores.
ajustels<-lm(l10muertes.permil~.,data = df_covid_total )
summary(ajustels)
##
## Call:
## lm(formula = l10muertes.permil ~ ., data = df_covid_total)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.73722 -0.23692 -0.00353 0.23116 0.90465
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -2.9869140 2.2438896 -1.331 0.18580
## Hombres80 -0.1855343 0.1279285 -1.450 0.14972
## Mujeres80 0.0235768 0.0857817 0.275 0.78393
## Pobla80 NA NA NA NA
## Pobla65 0.0648962 0.0352450 1.841 0.06818 .
## PoblaMid 0.0284269 0.0148852 1.910 0.05868 .
## PoblaData -0.0100806 0.0205972 -0.489 0.62549
## PoblaDens -0.0115589 0.0060235 -1.919 0.05749 .
## Mujeres 0.0226914 0.0200892 1.130 0.26105
## Urbano 0.0066679 0.0025300 2.636 0.00957 **
## ExpectVida 0.0210514 0.0209453 1.005 0.31699
## NeontlMort 0.0054847 0.0089112 0.615 0.53946
## DisMort -0.0012891 0.0146930 -0.088 0.93024
## Lesion -0.0020957 0.0128853 -0.163 0.87109
## EnfNoTrans -0.0116425 0.0088629 -1.314 0.19161
## Tuberculosis -0.0009200 0.0003822 -2.407 0.01768 *
## Diabetes 0.0185090 0.0124622 1.485 0.14025
## ImmunSaramp -0.0088272 0.0034935 -2.527 0.01288 *
## HipTen.H -0.0114184 0.0100937 -1.131 0.26033
## HipTen.M 0.0141302 0.0110152 1.283 0.20217
## BCG 0.4210976 0.1976027 2.131 0.03524 *
## Medicos 0.0513170 0.0590776 0.869 0.38687
## Camas -0.0632265 0.0257027 -2.460 0.01540 *
## PBI 0.0014607 0.0032764 0.446 0.65657
## TempMarzo -0.0130534 0.0059009 -2.212 0.02895 *
## muertes.permil 0.0033422 0.0003986 8.386 1.52e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3843 on 114 degrees of freedom
## Multiple R-squared: 0.7871, Adjusted R-squared: 0.7422
## F-statistic: 17.56 on 24 and 114 DF, p-value: < 2.2e-16
El valor R2ajustadoRajustado2 obtenido es muy alto (0.7871) lo que indica que el modelo es capaz de predecir con gran exactitud las muertes por covid de las observaciones con las que se ha entrenado. El hecho de que el modelo en conjunto sea significativo (p-value: < 2.2e-16), pero que muy pocos de los predictores lo sean a nivel individual, es indicativo de una posible redundancia entre los predictores (colinealidad).
Analizamos la matriz de correlacion
round(cor(df_covid_total),2)
## Hombres80 Mujeres80 Pobla80 Pobla65 PoblaMid PoblaData
## Hombres80 1.00 0.97 0.99 0.96 0.28 -0.02
## Mujeres80 0.97 1.00 1.00 0.98 0.27 -0.04
## Pobla80 0.99 1.00 1.00 0.98 0.28 -0.04
## Pobla65 0.96 0.98 0.98 1.00 0.32 0.00
## PoblaMid 0.28 0.27 0.28 0.32 1.00 0.11
## PoblaData -0.02 -0.04 -0.04 0.00 0.11 1.00
## PoblaDens 0.01 0.01 0.01 0.04 0.19 0.02
## Mujeres 0.28 0.30 0.30 0.32 -0.43 -0.04
## Urbano 0.48 0.46 0.47 0.46 0.53 -0.07
## ExpectVida 0.72 0.65 0.68 0.70 0.66 0.04
## NeontlMort -0.69 -0.69 -0.69 -0.72 -0.68 0.02
## DisMort -0.57 -0.49 -0.53 -0.51 -0.23 0.04
## Lesion -0.60 -0.61 -0.61 -0.65 -0.08 -0.01
## EnfNoTrans 0.71 0.70 0.71 0.76 0.72 0.05
## Tuberculosis -0.50 -0.47 -0.48 -0.49 -0.37 0.04
## Diabetes -0.08 -0.14 -0.12 -0.09 0.50 0.12
## ImmunSaramp 0.35 0.35 0.35 0.36 0.53 0.04
## HipTen.H 0.52 0.58 0.56 0.58 -0.01 -0.08
## HipTen.M 0.39 0.47 0.45 0.47 0.01 -0.07
## BCG -0.32 -0.27 -0.29 -0.28 -0.05 -0.03
## Medicos 0.78 0.81 0.81 0.80 0.46 -0.06
## Camas 0.65 0.74 0.71 0.73 0.33 -0.05
## PBI 0.46 0.44 0.45 0.44 0.59 -0.06
## TempMarzo -0.65 -0.69 -0.68 -0.71 -0.31 -0.04
## l10muertes.permil 0.68 0.65 0.67 0.66 0.36 -0.02
## muertes.permil 0.55 0.49 0.52 0.47 0.10 0.00
## PoblaDens Mujeres Urbano ExpectVida NeontlMort DisMort Lesion
## Hombres80 0.01 0.28 0.48 0.72 -0.69 -0.57 -0.60
## Mujeres80 0.01 0.30 0.46 0.65 -0.69 -0.49 -0.61
## Pobla80 0.01 0.30 0.47 0.68 -0.69 -0.53 -0.61
## Pobla65 0.04 0.32 0.46 0.70 -0.72 -0.51 -0.65
## PoblaMid 0.19 -0.43 0.53 0.66 -0.68 -0.23 -0.08
## PoblaData 0.02 -0.04 -0.07 0.04 0.02 0.04 -0.01
## PoblaDens 1.00 -0.06 0.13 0.15 -0.10 -0.15 -0.11
## Mujeres -0.06 1.00 -0.25 -0.12 0.02 0.04 -0.48
## Urbano 0.13 -0.25 1.00 0.66 -0.63 -0.57 -0.14
## ExpectVida 0.15 -0.12 0.66 1.00 -0.87 -0.70 -0.31
## NeontlMort -0.10 0.02 -0.63 -0.87 1.00 0.54 0.34
## DisMort -0.15 0.04 -0.57 -0.70 0.54 1.00 0.19
## Lesion -0.11 -0.48 -0.14 -0.31 0.34 0.19 1.00
## EnfNoTrans 0.03 0.07 0.55 0.85 -0.88 -0.34 -0.47
## Tuberculosis -0.05 0.07 -0.37 -0.68 0.60 0.40 0.13
## Diabetes 0.01 -0.39 0.16 0.27 -0.21 0.08 0.16
## ImmunSaramp 0.08 -0.05 0.29 0.58 -0.61 -0.30 -0.15
## HipTen.H -0.08 0.32 0.22 0.21 -0.34 -0.22 -0.52
## HipTen.M -0.12 0.25 0.15 0.08 -0.25 -0.07 -0.44
## BCG -0.02 -0.03 -0.26 -0.28 0.21 0.26 0.18
## Medicos 0.00 0.08 0.60 0.71 -0.77 -0.40 -0.48
## Camas 0.00 0.22 0.37 0.47 -0.61 -0.23 -0.47
## PBI 0.26 -0.48 0.66 0.68 -0.61 -0.56 -0.11
## TempMarzo 0.12 -0.21 -0.32 -0.53 0.58 0.22 0.48
## l10muertes.permil -0.04 0.00 0.57 0.65 -0.57 -0.53 -0.33
## muertes.permil -0.01 0.07 0.35 0.44 -0.34 -0.45 -0.27
## EnfNoTrans Tuberculosis Diabetes ImmunSaramp HipTen.H
## Hombres80 0.71 -0.50 -0.08 0.35 0.52
## Mujeres80 0.70 -0.47 -0.14 0.35 0.58
## Pobla80 0.71 -0.48 -0.12 0.35 0.56
## Pobla65 0.76 -0.49 -0.09 0.36 0.58
## PoblaMid 0.72 -0.37 0.50 0.53 -0.01
## PoblaData 0.05 0.04 0.12 0.04 -0.08
## PoblaDens 0.03 -0.05 0.01 0.08 -0.08
## Mujeres 0.07 0.07 -0.39 -0.05 0.32
## Urbano 0.55 -0.37 0.16 0.29 0.22
## ExpectVida 0.85 -0.68 0.27 0.58 0.21
## NeontlMort -0.88 0.60 -0.21 -0.61 -0.34
## DisMort -0.34 0.40 0.08 -0.30 -0.22
## Lesion -0.47 0.13 0.16 -0.15 -0.52
## EnfNoTrans 1.00 -0.63 0.32 0.56 0.30
## Tuberculosis -0.63 1.00 -0.24 -0.44 -0.14
## Diabetes 0.32 -0.24 1.00 0.23 -0.28
## ImmunSaramp 0.56 -0.44 0.23 1.00 0.09
## HipTen.H 0.30 -0.14 -0.28 0.09 1.00
## HipTen.M 0.24 -0.08 -0.21 0.09 0.90
## BCG -0.21 0.17 0.02 -0.06 -0.07
## Medicos 0.79 -0.52 0.03 0.46 0.48
## Camas 0.61 -0.33 -0.09 0.37 0.53
## PBI 0.49 -0.41 0.19 0.35 0.21
## TempMarzo -0.68 0.37 0.08 -0.33 -0.43
## l10muertes.permil 0.59 -0.48 0.06 0.23 0.32
## muertes.permil 0.32 -0.26 -0.13 0.16 0.23
## HipTen.M BCG Medicos Camas PBI TempMarzo
## Hombres80 0.39 -0.32 0.78 0.65 0.46 -0.65
## Mujeres80 0.47 -0.27 0.81 0.74 0.44 -0.69
## Pobla80 0.45 -0.29 0.81 0.71 0.45 -0.68
## Pobla65 0.47 -0.28 0.80 0.73 0.44 -0.71
## PoblaMid 0.01 -0.05 0.46 0.33 0.59 -0.31
## PoblaData -0.07 -0.03 -0.06 -0.05 -0.06 -0.04
## PoblaDens -0.12 -0.02 0.00 0.00 0.26 0.12
## Mujeres 0.25 -0.03 0.08 0.22 -0.48 -0.21
## Urbano 0.15 -0.26 0.60 0.37 0.66 -0.32
## ExpectVida 0.08 -0.28 0.71 0.47 0.68 -0.53
## NeontlMort -0.25 0.21 -0.77 -0.61 -0.61 0.58
## DisMort -0.07 0.26 -0.40 -0.23 -0.56 0.22
## Lesion -0.44 0.18 -0.48 -0.47 -0.11 0.48
## EnfNoTrans 0.24 -0.21 0.79 0.61 0.49 -0.68
## Tuberculosis -0.08 0.17 -0.52 -0.33 -0.41 0.37
## Diabetes -0.21 0.02 0.03 -0.09 0.19 0.08
## ImmunSaramp 0.09 -0.06 0.46 0.37 0.35 -0.33
## HipTen.H 0.90 -0.07 0.48 0.53 0.21 -0.43
## HipTen.M 1.00 -0.02 0.40 0.45 0.11 -0.32
## BCG -0.02 1.00 -0.23 -0.08 -0.23 0.31
## Medicos 0.40 -0.23 1.00 0.70 0.56 -0.73
## Camas 0.45 -0.08 0.70 1.00 0.37 -0.71
## PBI 0.11 -0.23 0.56 0.37 1.00 -0.35
## TempMarzo -0.32 0.31 -0.73 -0.71 -0.35 1.00
## l10muertes.permil 0.24 -0.39 0.62 0.36 0.54 -0.51
## muertes.permil 0.12 -0.59 0.39 0.20 0.38 -0.34
## l10muertes.permil muertes.permil
## Hombres80 0.68 0.55
## Mujeres80 0.65 0.49
## Pobla80 0.67 0.52
## Pobla65 0.66 0.47
## PoblaMid 0.36 0.10
## PoblaData -0.02 0.00
## PoblaDens -0.04 -0.01
## Mujeres 0.00 0.07
## Urbano 0.57 0.35
## ExpectVida 0.65 0.44
## NeontlMort -0.57 -0.34
## DisMort -0.53 -0.45
## Lesion -0.33 -0.27
## EnfNoTrans 0.59 0.32
## Tuberculosis -0.48 -0.26
## Diabetes 0.06 -0.13
## ImmunSaramp 0.23 0.16
## HipTen.H 0.32 0.23
## HipTen.M 0.24 0.12
## BCG -0.39 -0.59
## Medicos 0.62 0.39
## Camas 0.36 0.20
## PBI 0.54 0.38
## TempMarzo -0.51 -0.34
## l10muertes.permil 1.00 0.73
## muertes.permil 0.73 1.00
Podemos observar varios casos donde la correlación es del tipo alta y casi perfecta
ggcorr(df_covid_total, method = c("everything", "pearson"))
Conociendo esto decidimos eliminar las siguientes variables:
Nos quedamos con Pobla80 que representa la media
entre las mujeres de 80 y hombres de 80
Dado que entre el porcentaje de poblacion de 80 y 65 también existe una colinealidad perfecta, decidimos quedarnos con el porcentaje de 80 años
El de porcentaje de hipertención obtamos quedarnos unicamente con el de mujeres
Entre la expectativa de vida, las enfermedades no transmisoras y el neontmort, vamos a mantener la expectativa de vida
Las variables seleccionadas entonces son:
df_covid_total = data.frame( Pobla80,PoblaMid, PoblaData, PoblaDens, Mujeres, Urbano,DisMort, Lesion,Tuberculosis,Diabetes, ImmunSaramp,HipTen.M, BCG,Medicos,Camas,PBI,TempMarzo,l10muertes.permil)
Volvemos a correr un modelo considerando estas variables
ajustels<-lm(l10muertes.permil~.,data = df_covid_total )
summary(ajustels)
##
## Call:
## lm(formula = l10muertes.permil ~ ., data = df_covid_total)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.03352 -0.32453 0.00078 0.28469 1.18822
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.2074581 1.4481831 -0.143 0.886328
## Pobla80 0.1678347 0.0491913 3.412 0.000878 ***
## PoblaMid 0.0179866 0.0113805 1.580 0.116610
## PoblaData 0.0015105 0.0252924 0.060 0.952477
## PoblaDens -0.0135871 0.0069675 -1.950 0.053481 .
## Mujeres 0.0189388 0.0206484 0.917 0.360862
## Urbano 0.0059219 0.0030802 1.923 0.056884 .
## DisMort -0.0104358 0.0117804 -0.886 0.377449
## Lesion 0.0007857 0.0140986 0.056 0.955648
## Tuberculosis -0.0007458 0.0003891 -1.917 0.057647 .
## Diabetes 0.0012350 0.0142983 0.086 0.931310
## ImmunSaramp -0.0080585 0.0040730 -1.979 0.050142 .
## HipTen.M 0.0035230 0.0064671 0.545 0.586924
## BCG -0.3865863 0.2136311 -1.810 0.072840 .
## Medicos -0.0064583 0.0677158 -0.095 0.924176
## Camas -0.0913157 0.0294257 -3.103 0.002383 **
## PBI 0.0066034 0.0038957 1.695 0.092639 .
## TempMarzo -0.0113363 0.0066844 -1.696 0.092470 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4786 on 121 degrees of freedom
## Multiple R-squared: 0.6495, Adjusted R-squared: 0.6002
## F-statistic: 13.19 on 17 and 121 DF, p-value: < 2.2e-16
XX<-model.matrix(ajustels) #matriz de disenio
det(solve(t(XX)%*%XX))#determinante de (X'X)^-1
## [1] 5.933772e-60
Análisis de inflación de varianza
vif(ajustels)
## Pobla80 PoblaMid PoblaData PoblaDens Mujeres Urbano
## 5.808401 3.131862 1.085931 1.367075 3.199217 2.739142
## DisMort Lesion Tuberculosis Diabetes ImmunSaramp HipTen.M
## 2.619971 2.241925 1.782519 1.748519 1.746224 1.551978
## BCG Medicos Camas PBI TempMarzo
## 1.324575 5.538386 3.183954 4.258259 3.316220
Ninguna variable super el 10 por lo que no estamos en presencia de un problema de colinealidad
dwt(ajustels, alternative = "two.sided")
## lag Autocorrelation D-W Statistic p-value
## 1 0.07098641 1.853144 0.368
## Alternative hypothesis: rho != 0
A la hora de seleccionar los predictores que deben formar parte del modelo se pueden seguir varios métodos para este ejercicio emplearemos el método paso a paso (stepwise), el cualemplea criterios matemáticos para decidir qué predictores contribuyen significativamente al modelo y en qué orden se introducen. Dentro de este método se diferencias tres estrategias: Dirección forward,Dirección backward o Doble o mixto.
El método paso a paso requiere de algún criterio matemático para determinar si el modelo mejora o empeora con cada incorporación o extracción. Existen varios parámetros empelados, de entre los que destacan el \(Cp\) \(AIC\), \(BIC\) y $R^2ajustado$, cada uno de ellos con ventajas e inconvenientes. El método Akaike(AIC) tiende a ser más restrictivo e introducir menos predictores que el R2-ajustado. Para un mismo set de datos, no todos los métodos tienen porque concluir en un mismo modelo.
En este caso se van a emplear la estrategia de stepwise mixto. El valor matemático empleado para determinar la calidad del modelo va a ser Akaike(AIC). Vamos a utilizar como variables de respuesta tanto la logaritmica como la de muertes por mil.
Modelo considerando l10muertes.permil
df_covid_l10muertes = data.frame(Pobla80,PoblaMid, PoblaData, PoblaDens, Mujeres, Urbano,DisMort, Lesion,Tuberculosis,Diabetes, ImmunSaramp,HipTen.M, BCG,Medicos,Camas,PBI,TempMarzo,l10muertes.permil)
df_covid_l10muertes
## Pobla80 PoblaMid PoblaData PoblaDens Mujeres Urbano DisMort Lesion
## 1 0.2771541 54.32490 0.37172386 0.56937760 48.63585 25.495 29.8 19.5
## 2 2.7410163 68.58239 0.02866376 1.04612263 49.06309 60.319 17.0 4.0
## 3 1.2709846 63.48882 0.42228429 0.17730075 49.48427 72.629 14.2 9.5
## 4 0.2723907 50.97470 0.30809762 0.24713052 50.53046 65.514 16.5 9.2
## 5 2.6111754 64.12128 0.44494502 0.16258510 51.23735 91.870 15.8 6.5
## 6 3.1239347 68.11276 0.02951776 1.03680225 52.95658 63.149 22.3 3.9
## 7 4.0436339 65.15291 0.24992369 0.03249129 50.19962 86.012 9.1 5.9
## 8 5.2369767 66.70049 0.08847037 1.07206927 50.82943 58.297 11.4 5.2
## 9 1.3597424 70.43525 0.09942334 1.20265320 50.11575 55.680 22.2 4.6
## 10 0.9964088 67.13559 1.61356039 12.39579312 49.38730 36.632 21.6 7.5
## 11 3.8045048 68.28891 0.09485386 0.46728800 53.45605 78.595 23.7 7.0
## 12 5.6948380 64.15583 0.11422068 3.77214927 50.59332 98.001 11.4 6.4
## 13 1.0395255 64.98378 0.00383071 0.16793994 50.19252 45.724 22.1 13.2
## 14 0.4365651 54.29871 0.11485048 1.01853920 50.09820 47.312 19.6 10.2
## 15 1.2095158 68.22563 0.00754394 0.19777528 47.00264 40.895 23.3 10.5
## 16 1.6248620 61.73450 0.11353142 0.10480146 49.78340 69.425 17.2 13.1
## 17 3.3861895 68.76346 0.03323929 0.64920488 51.01054 48.245 17.8 3.7
## 18 0.4939442 61.66318 0.02254126 0.03977425 51.73076 69.446 20.3 8.3
## 19 1.8060280 69.74309 2.09469333 0.25061716 50.82992 86.569 16.6 12.2
## 20 0.7583938 72.10039 0.00428962 0.81396964 48.03618 77.629 16.6 7.4
## 21 4.7222857 64.38262 0.07024216 0.64703537 51.41409 75.008 23.6 2.6
## 22 0.2453268 52.64494 0.19751535 0.72191283 50.09548 29.358 21.7 11.0
## 23 0.2917947 52.25138 0.11175378 4.35178271 50.42199 13.032 22.9 12.1
## 24 0.5703887 64.22991 0.16249798 0.92056413 51.19798 23.388 21.1 10.0
## 25 0.3083562 54.63954 0.25216237 0.53343989 50.00349 56.374 21.6 10.9
## 26 4.3071336 66.89774 0.37058856 0.04075308 50.39153 81.411 9.8 6.1
## 27 0.3528256 52.87991 0.04666377 0.07490412 50.43647 41.364 23.1 10.3
## 28 1.7597254 68.44406 0.49648685 0.44748702 50.92577 80.778 15.8 15.0
## 29 0.3889863 57.45457 0.00832322 4.47244478 49.55870 28.965 22.9 10.9
## 30 0.2877278 55.55478 0.05244363 0.15356846 50.06560 66.916 16.7 9.9
## 31 5.5638202 65.04263 0.04089400 0.73077198 51.85262 56.947 16.7 5.3
## 32 4.0918014 64.99252 0.10625695 1.37602888 50.80859 73.792 15.0 4.7
## 33 4.5174188 63.72878 0.05797446 1.38067302 50.27420 87.874 11.3 3.8
## 34 0.6099089 65.89830 0.00958920 0.41368421 47.36679 77.777 19.6 10.4
## 35 1.5873319 64.94005 0.10627165 2.19978576 50.00780 81.074 19.0 12.0
## 36 1.5376442 64.81412 0.17084357 0.68788682 49.97063 63.821 13.0 12.8
## 37 0.7910340 60.97150 0.98423595 0.98873469 49.46997 42.704 27.7 5.8
## 38 1.8419292 64.58083 0.06420744 3.09881467 53.11400 72.023 14.0 15.4
## 39 0.2886712 60.42552 0.01308974 0.46665740 44.45585 72.143 22.0 10.7
## 40 5.5491132 64.01657 0.01320884 0.30386105 52.85843 68.880 17.0 4.5
## 41 0.5012502 55.71589 1.09224559 1.09224559 49.97889 20.763 18.3 11.7
## 42 0.5795601 65.03770 0.00883483 0.48357033 49.30050 56.248 30.6 5.4
## 43 5.4057724 62.13403 0.05518050 0.18156856 50.72076 85.382 10.2 5.5
## 44 6.1032258 62.00891 0.66987244 1.22338396 51.58424 80.444 10.6 6.4
## 45 0.5335561 59.41022 0.02119275 0.08224764 49.06862 89.370 14.4 9.1
## 46 0.2595557 53.14127 0.02280102 2.25306522 50.40213 61.270 20.4 10.9
## 47 3.6827447 65.33927 0.03731000 0.65275202 52.29124 58.632 24.9 3.6
## 48 6.6270801 64.91701 0.82927922 2.37370970 50.66037 77.312 12.1 4.0
## 49 0.3266130 59.33504 0.29767108 1.30821429 49.32583 56.060 20.8 9.8
## 50 7.2679122 64.27348 0.10727668 0.83224732 50.91620 79.058 12.4 2.9
## 51 1.0548473 60.75253 0.17247807 1.60953779 50.75935 51.054 14.9 15.7
## 52 0.3195615 53.22380 0.12414318 0.50522212 51.82111 36.140 22.4 9.2
## 53 1.2722362 65.33518 0.00779004 0.03957348 49.80802 26.606 30.5 12.4
## 54 0.8276328 61.80835 0.11123176 4.03598549 50.65221 55.278 26.5 12.6
## 55 1.0293956 63.56850 0.09587522 0.85687032 50.04934 57.096 14.0 19.6
## 56 4.2713096 66.43028 0.09768785 1.07906606 52.43243 71.351 23.0 4.4
## 57 0.3130915 50.39318 0.15477751 0.12291734 50.08490 23.059 23.9 9.3
## 58 2.7008155 68.71630 0.18729160 0.25189446 50.72703 87.564 12.4 7.1
## 59 1.7877871 71.20211 13.92730000 1.48348833 48.67937 59.152 17.0 7.0
## 60 0.9448065 66.76674 13.52617328 4.54938073 48.02354 34.030 23.3 11.3
## 61 0.8561815 67.59164 2.67663435 1.47752190 49.64388 55.325 26.4 6.0
## 62 1.1233084 69.33887 0.81800269 0.50222420 49.43913 74.898 14.8 10.1
## 63 0.4831038 58.28983 0.38433600 0.88530570 49.40868 70.473 21.3 28.4
## 64 3.0188525 64.72778 0.04853506 0.70452983 50.42551 63.170 10.3 4.3
## 65 3.0461867 60.09777 0.08883800 4.10526802 50.29813 92.418 9.6 4.1
## 66 7.1734357 63.91920 0.60431283 2.05450748 51.37667 70.438 9.5 3.8
## 67 2.0456797 67.45326 0.02934855 2.70993075 50.33983 55.674 14.7 8.7
## 68 8.3613475 59.72678 1.26529100 3.47073458 51.15926 91.616 8.4 4.8
## 69 0.6023762 61.90802 0.09956011 1.12142498 49.38968 90.979 19.2 10.9
## 70 1.4932044 64.14760 0.18276499 0.06769826 51.51148 57.428 26.8 9.5
## 71 0.2699139 57.87865 0.51393010 0.90299417 50.31602 27.030 13.4 9.6
## 72 0.2327419 75.91064 0.04137309 2.32172222 39.54817 100.000 17.4 12.8
## 73 5.5652960 63.96060 0.01926542 0.30983307 54.01017 68.142 21.9 5.4
## 74 1.4828557 66.90176 0.06848925 6.69494135 49.70581 88.593 17.9 5.8
## 75 0.8209008 62.38256 0.02108132 0.69437813 50.71690 28.153 26.6 8.3
## 76 0.3996440 55.62158 0.04818977 0.50030907 49.76829 51.151 17.6 10.0
## 77 0.7605248 67.28872 0.06678567 0.03795632 49.48379 80.102 20.1 20.1
## 78 5.8370281 65.41254 0.02789533 0.44531351 53.79196 67.679 20.7 6.6
## 79 4.0235270 69.93802 0.00607728 2.50093827 49.53926 90.981 10.0 6.7
## 80 0.4241700 56.34513 0.26262368 0.45139856 50.12397 37.191 22.9 10.6
## 81 0.3087382 53.45228 0.18143315 1.92440762 50.70152 16.937 16.4 8.6
## 82 1.0741699 69.33310 0.31528585 0.95962821 48.57852 76.036 17.2 8.9
## 83 0.2683715 49.94928 0.19077690 0.15635016 49.94100 42.356 24.6 8.9
## 84 0.4204185 56.77571 0.04403319 0.04272164 49.82266 53.672 18.1 9.4
## 85 2.0227961 70.73213 0.01265303 6.23301970 50.57711 40.793 22.6 4.8
## 86 1.5523039 66.21947 1.26190788 0.64914626 51.08928 80.156 15.7 10.3
## 87 2.2672524 72.67035 0.03545883 1.23519804 52.03556 42.629 24.9 5.7
## 88 0.6283914 65.50689 0.03170208 0.02040609 50.66954 68.445 30.2 10.6
## 89 3.4204855 66.81554 0.00622345 0.46271004 50.55901 66.813 20.6 3.5
## 90 1.1687236 65.78072 0.36029138 0.80728519 50.40385 62.453 12.4 6.4
## 91 0.3481273 52.43844 0.29495962 0.37508535 51.47519 35.988 18.4 7.8
## 92 0.7791075 67.84431 0.53708395 0.82238615 51.80790 30.579 24.2 8.6
## 93 0.6151794 59.45372 0.02448255 0.02973746 51.55369 50.032 21.3 9.8
## 94 0.7516195 63.85806 0.28087871 1.95939107 54.53534 19.740 21.8 8.8
## 95 4.6976392 64.69565 0.17231017 5.11457910 50.22094 91.490 11.2 5.2
## 96 3.7311137 64.69414 0.04885500 0.18554176 50.83777 86.538 10.1 6.0
## 97 1.1025688 64.55082 0.06465513 0.53727048 50.71271 58.522 14.2 12.7
## 98 0.2340882 47.42067 0.22442948 0.17717651 49.77100 16.425 20.0 10.4
## 99 4.2231531 65.40174 0.05314336 0.14554920 49.52463 82.248 9.2 5.6
## 100 0.4596337 75.36071 0.04829483 0.15604145 34.01408 84.539 17.8 17.7
## 101 0.6545620 60.41741 2.12215030 2.75289319 48.53807 36.666 24.7 7.3
## 102 1.9205337 64.83296 0.04176873 0.56186077 49.90538 67.709 13.0 9.7
## 103 1.2135437 64.12928 0.06956071 0.17508359 49.15161 61.585 17.5 12.0
## 104 1.6809015 66.12100 0.31989256 0.24991606 50.33776 77.907 12.6 10.5
## 105 0.7893793 63.91439 1.06651922 3.57688305 49.74166 46.907 26.8 7.5
## 106 4.4631164 67.42991 0.37978548 1.24035886 51.53071 60.058 18.7 4.7
## 107 6.3408699 64.58823 0.10281762 1.12239454 52.71196 65.211 11.1 4.2
## 108 0.1847213 85.08917 0.02781677 2.39593196 24.49529 99.135 15.3 25.9
## 109 4.7084438 66.12674 0.19473936 0.84639847 51.34374 53.998 21.4 3.6
## 110 0.3624706 57.08623 0.12301939 4.98659870 50.86106 17.211 18.2 13.5
## 111 2.4482249 67.86891 0.00110210 2.82589744 49.20878 52.198 23.2 5.6
## 112 0.5038453 71.64306 0.33699947 0.15676654 42.44585 83.844 16.4 16.3
## 113 0.3825330 53.85775 0.15854360 0.82347478 51.27733 47.192 18.1 12.2
## 114 4.0191136 65.96453 0.06982084 0.79831740 51.00252 56.092 19.1 3.0
## 115 0.3522140 55.97380 0.07650154 1.05987171 50.12127 42.055 30.5 8.9
## 116 2.1766595 76.25834 0.05638676 79.52998418 47.65813 100.000 9.3 3.7
## 117 3.2223629 68.92462 0.05447011 1.13290578 51.33833 53.726 17.2 6.0
## 118 5.3152643 65.37135 0.02067372 1.02639860 50.24521 54.541 12.7 6.6
## 119 0.7184723 65.60251 0.57779622 0.47630120 50.69415 66.355 26.2 9.1
## 120 3.2120425 72.60812 0.51635256 5.29652104 49.91688 81.459 7.8 10.0
## 121 6.1672057 65.95449 0.46723749 0.93529058 50.89664 80.321 9.9 3.5
## 122 1.6065781 65.32978 0.21670000 3.45558922 51.96682 18.476 17.4 9.7
## 123 5.1726032 62.32269 0.10183175 0.25001043 49.94578 87.431 9.1 4.9
## 124 5.1493834 66.46583 0.08516543 2.15521378 50.42712 73.797 8.6 6.1
## 125 0.5234433 60.19383 0.09100837 0.65572714 49.58384 27.134 25.3 7.6
## 126 2.5315654 71.01212 0.69428524 1.35897207 51.26870 49.949 14.5 10.2
## 127 0.2700138 55.79601 0.07889094 1.45046773 50.26805 41.702 23.6 10.7
## 128 1.7197442 67.51420 0.11565204 0.74441323 50.43715 68.945 16.1 6.4
## 129 1.6774797 66.86738 0.82319724 1.06960129 50.67781 75.143 16.1 6.2
## 130 0.2057545 51.12849 0.42723139 2.13061734 50.77608 23.774 21.9 12.7
## 131 3.9876216 67.75290 0.44622516 0.77029667 53.68775 69.352 24.7 5.0
## 132 0.1307769 84.31149 0.09630959 1.35609110 30.63669 86.522 16.8 16.8
## 133 5.0282090 63.92605 0.66488991 2.74827392 50.63527 83.398 10.9 3.5
## 134 3.8751036 65.48331 3.27167434 0.35766089 50.52001 82.256 14.6 6.6
## 135 4.3947641 64.57750 0.03449299 0.19708028 51.72154 95.334 16.7 7.5
## 136 0.8369038 66.89480 0.32955400 0.77469205 50.13736 50.478 24.5 6.0
## 137 0.3498816 57.50884 0.28498687 0.53977853 49.61166 36.642 30.6 14.7
## 138 0.2529708 52.96418 0.17351822 0.23341479 50.49321 43.521 17.9 10.2
## 139 0.4222739 54.65941 0.14439018 0.37324591 52.35675 32.209 19.3 12.3
## Tuberculosis Diabetes ImmunSaramp HipTen.M BCG Medicos Camas
## 1 189.0 9.2 64 19.8 1 0.24009091 0.4363636
## 2 18.0 9.0 94 39.4 1 1.21237143 2.9375000
## 3 69.0 6.7 80 23.0 1 1.31202500 1.9000000
## 4 355.0 4.5 50 25.2 1 0.17300000 0.8000000
## 5 27.0 5.9 94 32.9 1 3.57165000 4.6000000
## 6 31.0 6.1 95 43.4 1 3.06122500 4.0200000
## 7 6.6 5.6 95 32.8 1 3.27402222 3.8783333
## 8 7.1 6.6 94 38.8 1 4.66801111 7.7000000
## 9 63.0 6.1 96 31.4 1 3.58736250 6.4666667
## 10 221.0 9.2 97 17.4 1 0.39047692 0.5750000
## 11 31.0 5.0 97 45.5 1 4.22154000 11.2000000
## 12 9.0 4.6 96 35.0 0 2.79814444 6.5500000
## 13 30.0 17.1 97 25.1 1 0.96785000 1.1600000
## 14 56.0 1.0 71 40.3 1 0.11874000 0.5000000
## 15 149.0 10.3 97 20.4 1 0.26431111 1.7333333
## 16 108.0 6.8 89 27.2 1 0.71612500 1.1000000
## 17 25.0 9.0 68 43.2 1 1.77503333 3.3666667
## 18 275.0 5.8 97 41.0 1 0.35774444 2.0000000
## 19 45.0 10.4 84 38.5 1 1.84654000 2.3285714
## 20 68.0 13.3 99 32.0 1 1.38302727 2.7542857
## 21 22.0 6.0 93 46.5 1 3.80887500 6.4888889
## 22 48.0 7.3 88 12.4 1 0.04237143 0.6500000
## 23 111.0 5.1 88 30.8 1 0.04885000 1.1333333
## 24 302.0 6.4 84 24.1 1 0.24971429 0.7600000
## 25 186.0 6.0 71 17.9 1 0.07534000 1.4000000
## 26 5.6 7.6 90 23.9 0 2.32944444 3.0714286
## 27 540.0 6.0 49 33.2 1 0.04973333 1.1000000
## 28 33.0 7.4 95 28.7 1 1.70129231 1.3166667
## 29 35.0 12.3 90 41.5 1 0.18323333 2.2000000
## 30 375.0 6.0 75 19.3 1 0.12880000 1.6000000
## 31 8.4 5.4 93 38.5 1 2.80697000 5.6354545
## 32 5.4 7.0 96 42.6 1 3.70292500 7.0100000
## 33 5.4 8.3 95 34.6 1 3.56958333 3.4111111
## 34 260.0 5.1 86 22.3 1 0.21512500 1.4571429
## 35 45.0 8.6 95 29.3 1 1.37733333 1.4375000
## 36 44.0 5.5 83 28.6 1 1.90360000 1.5285714
## 37 12.0 17.2 94 23.9 1 1.73048750 1.5100000
## 38 70.0 8.8 81 30.0 1 1.65428000 0.9900000
## 39 201.0 6.0 30 25.2 1 0.40000000 2.0666667
## 40 13.0 4.2 87 42.9 1 3.34070000 5.3600000
## 41 151.0 4.3 61 22.2 1 0.03620000 1.7500000
## 42 54.0 14.7 94 25.0 1 0.58042000 2.1475000
## 43 4.7 5.6 96 46.6 1 3.14394000 5.9600000
## 44 8.9 4.8 90 38.5 1 3.26508571 6.9222222
## 45 525.0 6.0 59 43.6 1 0.36110000 3.2000000
## 46 174.0 1.9 91 30.4 1 0.09858333 1.0000000
## 47 80.0 5.8 98 41.0 1 4.62520000 3.1222222
## 48 7.3 10.4 97 34.2 1 3.84022000 8.2555556
## 49 148.0 2.5 92 41.4 1 0.12015714 0.9000000
## 50 4.5 4.7 97 36.4 1 5.71011111 4.6555556
## 51 26.0 10.0 87 26.5 1 0.62945000 0.6250000
## 52 176.0 2.4 48 41.0 1 0.09196667 0.3000000
## 53 83.0 11.6 98 26.3 1 0.56823333 2.1600000
## 54 176.0 6.7 69 26.7 1 0.18585000 1.0000000
## 55 37.0 7.3 89 25.7 1 0.57160000 0.7285714
## 56 6.4 6.9 99 47.4 1 3.24861667 7.3000000
## 57 142.0 6.0 37 31.3 1 0.04200000 0.4000000
## 58 18.0 8.6 93 28.2 1 1.03645000 2.1714286
## 59 61.0 9.2 99 32.3 1 1.57320000 3.4066667
## 60 199.0 10.4 90 29.2 1 0.67390833 0.8000000
## 61 316.0 6.3 75 24.7 1 0.24655000 0.9000000
## 62 14.0 9.6 99 25.9 1 0.98516000 1.4400000
## 63 42.0 8.8 83 23.9 1 0.72533333 1.3100000
## 64 7.0 3.2 92 32.2 1 2.81283000 3.9555556
## 65 4.0 9.7 98 40.1 1 3.38105556 3.5333333
## 66 7.0 5.0 93 36.5 0 3.94927778 3.6875000
## 67 2.9 11.3 89 33.6 1 0.54227143 1.7571429
## 68 14.0 5.6 97 37.5 1 2.27806667 13.7960000
## 69 5.0 12.7 92 26.3 1 2.24923636 1.7818182
## 70 68.0 6.1 99 33.1 1 3.60587000 7.4111111
## 71 292.0 3.1 89 36.8 1 0.18122857 1.4000000
## 72 23.0 12.2 99 26.5 1 2.16873636 1.9800000
## 73 29.0 5.0 98 36.7 1 3.38225000 6.8111111
## 74 11.0 11.2 82 29.6 0 2.55344444 3.3800000
## 75 611.0 4.5 90 35.0 1 0.06760000 1.3000000
## 76 308.0 2.4 91 40.3 1 0.02466667 0.7500000
## 77 40.0 10.2 97 23.6 1 1.98748333 3.6700000
## 78 44.0 3.8 92 40.5 1 4.08613000 7.1666667
## 79 8.0 5.0 99 37.1 1 2.85313000 5.3727273
## 80 233.0 4.5 62 32.2 1 0.17360000 0.2500000
## 81 181.0 4.5 87 32.6 1 0.01767500 1.2000000
## 82 92.0 16.7 96 25.2 1 1.24358000 1.8312500
## 83 53.0 2.4 70 32.1 1 0.09575714 0.3333333
## 84 93.0 7.1 78 29.5 1 0.14066667 0.4000000
## 85 13.0 22.0 99 48.4 1 1.45775556 3.2333333
## 86 23.0 13.5 97 28.5 1 2.03156667 1.5888889
## 87 86.0 5.7 93 42.2 1 2.62560000 6.1666667
## 88 428.0 4.7 99 30.6 1 2.96358889 6.3266667
## 89 15.0 9.0 58 41.9 1 2.08927778 4.0125000
## 90 99.0 7.0 99 33.0 1 0.63655000 0.9800000
## 91 551.0 3.3 85 31.5 1 0.04688750 0.7666667
## 92 338.0 3.9 93 25.5 1 0.53712000 0.7500000
## 93 524.0 4.5 82 41.9 1 0.37305000 3.0000000
## 94 151.0 7.2 91 22.1 1 0.57297500 2.6500000
## 95 5.3 5.4 93 33.8 0 3.40828889 4.6000000
## 96 7.3 6.2 92 30.9 1 2.70726000 2.5500000
## 97 41.0 11.4 99 26.2 1 0.74390000 0.9222222
## 98 87.0 2.4 77 32.4 1 0.03340000 0.3000000
## 99 4.1 5.3 96 33.0 1 4.21626667 4.2555556
## 100 5.9 10.1 99 26.2 1 1.95183077 1.8600000
## 101 265.0 19.9 76 21.1 1 0.84727500 0.7200000
## 102 52.0 7.7 98 24.6 1 1.43397000 2.2888889
## 103 43.0 9.6 93 27.2 1 0.96393333 1.2857143
## 104 123.0 6.6 85 17.8 1 1.18280000 1.4875000
## 105 554.0 7.1 67 23.5 1 1.25186667 0.5833333
## 106 16.0 6.1 93 35.0 1 2.19399000 6.5222222
## 107 24.0 9.8 99 35.7 1 3.79097273 3.4222222
## 108 31.0 15.6 99 36.2 1 2.47302500 1.6400000
## 109 68.0 6.9 90 46.7 1 2.40146667 6.4555556
## 110 59.0 5.1 99 30.4 1 0.09168889 1.6000000
## 111 6.3 11.6 99 30.7 1 0.65870000 3.3000000
## 112 10.0 15.8 98 27.0 1 2.25626250 2.2500000
## 113 118.0 2.4 82 40.4 1 0.14020000 0.2000000
## 114 17.0 9.0 92 41.6 1 2.42901111 5.6125000
## 115 298.0 2.4 80 39.7 1 0.02050000 0.4000000
## 116 47.0 5.5 95 22.1 1 1.76859091 2.7457143
## 117 5.8 6.5 96 33.7 1 3.11790000 6.3400000
## 118 5.3 5.9 93 37.2 1 2.59476000 4.6555556
## 119 520.0 12.7 70 45.9 1 0.76988750 2.8000000
## 120 66.0 6.9 98 23.5 1 2.05984615 10.6080000
## 121 9.4 6.9 97 37.1 1 4.15920000 3.1888889
## 122 64.0 10.7 99 25.8 1 0.77147000 3.5500000
## 123 5.5 4.8 97 37.0 0 4.03310000 2.7666667
## 124 6.4 5.7 96 31.7 1 4.00455000 5.1222222
## 125 84.0 6.1 98 25.4 1 1.78443333 5.2666667
## 126 153.0 7.0 96 23.8 1 0.40473333 2.1000000
## 127 36.0 2.4 85 40.1 1 0.08897500 0.8000000
## 128 35.0 8.5 96 25.2 1 1.16097143 2.0545455
## 129 16.0 11.1 96 35.1 1 1.65210000 2.4555556
## 130 200.0 2.5 86 32.7 1 0.10457500 0.7500000
## 131 80.0 6.1 91 50.6 1 3.35196667 8.9222222
## 132 1.0 16.3 99 19.2 1 1.70489167 1.6777778
## 133 8.0 3.9 92 29.9 1 2.75287500 3.2111111
## 134 3.0 10.8 92 31.8 0 2.52747500 3.0333333
## 135 33.0 7.3 97 38.8 1 4.16766000 2.5250000
## 136 70.0 6.5 96 27.7 1 2.50781250 4.5888889
## 137 48.0 5.4 64 12.4 1 0.30986667 0.6900000
## 138 346.0 4.5 94 27.4 1 0.08791250 1.9500000
## 139 210.0 1.8 88 32.0 1 0.06561250 2.3500000
## PBI TempMarzo l10muertes.permil
## 1 1.8351696 7.60 0.85166698
## 2 11.3351950 6.04 1.09735434
## 3 14.1967389 17.91 1.19736588
## 4 6.7205961 22.78 0.05301271
## 5 20.0684923 17.51 1.08768715
## 6 8.3491802 -0.57 1.53403057
## 7 45.7525548 25.37 0.70937665
## 8 48.9687140 1.42 1.86867832
## 9 17.0906963 4.97 0.80830014
## 10 3.3061083 25.42 0.64062316
## 11 18.1721809 -0.69 1.37219412
## 12 45.2631622 5.23 2.91424609
## 13 8.0937796 24.45 0.79385771
## 14 2.0675705 30.14 0.10078712
## 15 8.3417246 5.68 0.00000000
## 16 6.5317860 22.07 1.40930364
## 17 11.6971771 4.01 1.66678153
## 18 16.1336867 24.30 0.15945618
## 19 15.5847506 25.49 2.09062497
## 20 80.8004129 25.92 0.75300190
## 21 17.9465777 4.70 1.29960529
## 22 1.6709928 30.63 0.56624131
## 23 0.7568378 20.43 0.03722023
## 24 3.3333517 27.93 0.00000000
## 25 3.2930885 26.27 0.90413575
## 26 44.2264907 -18.72 2.26374838
## 27 0.8532664 26.96 0.08432564
## 28 13.2116325 25.14 1.23486238
## 29 2.6420144 25.20 0.53185125
## 30 5.6636489 25.60 0.66491803
## 31 22.9922117 5.83 1.40989932
## 32 32.7718057 2.80 1.48902061
## 33 48.5249925 2.24 1.99324531
## 34 2.7442687 25.75 1.29603122
## 35 13.9050879 22.88 1.65899033
## 36 10.8759023 21.93 2.28487232
## 37 10.8110341 17.83 0.96804820
## 38 7.2348467 25.70 0.84966889
## 39 30.5908474 25.04 1.00721356
## 40 28.8340001 -2.35 1.70728513
## 41 1.5126247 23.48 0.02322475
## 42 8.8754441 25.00 0.00000000
## 43 42.8552430 -6.09 1.76134842
## 44 40.3515680 6.37 2.63132934
## 45 17.0778163 26.14 0.88115819
## 46 2.4051919 27.32 0.15793307
## 47 9.5834608 0.72 0.62493108
## 48 46.5762068 3.87 2.01040779
## 49 3.9219764 29.52 0.33086008
## 50 27.2065489 8.19 1.23366924
## 51 7.5159291 22.94 0.69394933
## 52 2.0022876 27.63 0.43000974
## 53 7.1987245 25.65 1.17956888
## 54 1.7058976 23.47 0.60817085
## 55 4.4336960 23.38 1.32704478
## 56 25.7573736 5.44 1.72513328
## 57 2.0073216 26.55 0.71053771
## 58 22.2523960 10.87 1.66184336
## 59 13.5313781 0.49 0.63650295
## 60 5.8366566 23.45 0.63846947
## 61 10.5772045 25.79 0.81312576
## 62 18.4501839 11.33 1.97066822
## 63 15.8895142 15.12 0.74455172
## 64 59.3055780 6.00 2.52768884
## 65 34.5710854 14.96 1.51362517
## 66 37.7630816 6.52 2.73899149
## 67 8.5085469 23.44 0.60923050
## 68 39.1530060 2.52 0.89103814
## 69 9.2014965 13.08 0.27966158
## 70 24.1030338 -3.96 0.48064752
## 71 2.8839337 26.10 0.31600904
## 72 75.8307296 19.23 1.63646809
## 73 23.8146826 -1.37 1.11188355
## 74 13.2450688 10.39 0.68089875
## 75 2.9043623 15.13 0.00000000
## 76 1.2563111 26.44 0.81973136
## 77 19.3396159 17.76 0.20382969
## 78 27.8087523 -0.47 1.39199086
## 79 100.2191161 4.70 2.26007623
## 80 1.7044431 23.99 0.03187466
## 81 1.1836484 23.25 0.08652600
## 82 25.8714034 25.19 0.66721788
## 83 2.0131236 27.34 0.66924316
## 84 3.8172107 25.29 0.66592067
## 85 19.3987280 25.48 0.94954834
## 86 17.8555895 18.44 1.83964772
## 87 5.8933274 2.93 1.89361039
## 88 11.1277975 -8.80 0.00000000
## 89 16.2734892 2.53 1.18924972
## 90 7.4795258 13.09 0.81997625
## 91 1.2616857 25.48 0.01447977
## 92 5.0214146 22.74 0.04599322
## 93 10.2230967 22.67 0.00000000
## 94 2.4752041 10.02 0.05782208
## 95 49.9843155 4.95 2.53367393
## 96 36.4995043 13.60 0.74060910
## 97 4.8837325 24.95 0.80708405
## 98 0.9278714 26.01 0.58564967
## 99 62.6503184 -5.49 1.65533067
## 100 42.4790524 23.40 0.94784219
## 101 4.6501098 16.01 0.84119511
## 102 20.8839055 25.44 1.88318015
## 103 11.4029323 25.84 0.41184731
## 104 12.3515166 19.99 2.09868025
## 105 7.0082665 25.13 0.97663292
## 106 25.9904310 2.65 1.44821011
## 107 29.3390041 11.33 2.12347272
## 108 123.2139364 21.78 1.07132447
## 109 21.6182719 3.40 1.80343313
## 110 1.7889788 19.25 0.00000000
## 111 10.9317631 25.90 0.00000000
## 112 51.5878305 20.60 1.13389947
## 113 3.1310271 28.47 0.53906244
## 114 14.9080484 4.91 1.54868038
## 115 1.4959394 27.65 0.83772947
## 116 86.0684237 28.62 0.70577580
## 117 29.0915206 2.40 0.78819906
## 118 31.7402860 3.38 1.72227622
## 119 12.8666891 21.10 1.02339821
## 120 34.6370853 3.66 0.79306494
## 121 34.5888453 8.60 2.76446761
## 122 11.1185327 27.03 0.16478915
## 123 47.6285919 -4.98 2.61847597
## 124 61.3146089 0.09 2.28867018
## 125 2.7293337 -3.08 0.78207686
## 126 15.8571484 27.38 0.26030714
## 127 1.4956789 29.31 0.42289247
## 128 11.2660561 14.21 0.71183934
## 129 23.5212137 4.77 1.73570816
## 130 1.8103287 23.68 0.00000000
## 131 8.4417522 1.18 1.18842716
## 132 65.5180899 22.61 1.43897112
## 133 41.1611271 4.66 2.75158819
## 134 55.0581658 0.06 2.48855760
## 135 20.4797528 21.26 0.86794498
## 136 6.8361061 5.38 0.15375896
## 137 3.5314239 20.82 0.45632576
## 138 3.8025013 22.90 0.14718638
## 139 2.5606953 22.92 0.10620013
modelo_l10muertes<-lm(l10muertes.permil~.,data = df_covid_l10muertes)
summary(modelo_l10muertes)
##
## Call:
## lm(formula = l10muertes.permil ~ ., data = df_covid_l10muertes)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.03352 -0.32453 0.00078 0.28469 1.18822
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.2074581 1.4481831 -0.143 0.886328
## Pobla80 0.1678347 0.0491913 3.412 0.000878 ***
## PoblaMid 0.0179866 0.0113805 1.580 0.116610
## PoblaData 0.0015105 0.0252924 0.060 0.952477
## PoblaDens -0.0135871 0.0069675 -1.950 0.053481 .
## Mujeres 0.0189388 0.0206484 0.917 0.360862
## Urbano 0.0059219 0.0030802 1.923 0.056884 .
## DisMort -0.0104358 0.0117804 -0.886 0.377449
## Lesion 0.0007857 0.0140986 0.056 0.955648
## Tuberculosis -0.0007458 0.0003891 -1.917 0.057647 .
## Diabetes 0.0012350 0.0142983 0.086 0.931310
## ImmunSaramp -0.0080585 0.0040730 -1.979 0.050142 .
## HipTen.M 0.0035230 0.0064671 0.545 0.586924
## BCG -0.3865863 0.2136311 -1.810 0.072840 .
## Medicos -0.0064583 0.0677158 -0.095 0.924176
## Camas -0.0913157 0.0294257 -3.103 0.002383 **
## PBI 0.0066034 0.0038957 1.695 0.092639 .
## TempMarzo -0.0113363 0.0066844 -1.696 0.092470 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4786 on 121 degrees of freedom
## Multiple R-squared: 0.6495, Adjusted R-squared: 0.6002
## F-statistic: 13.19 on 17 and 121 DF, p-value: < 2.2e-16
El modelo con todas las variables introducidas como predictores tiene un \(R^2\) alta (0.6495), es capaz de explicar el 65% de la variabilidad observada en la muertes logarimicas por mil de covid. El p-value del modelo es significativo (2.2e-16) por lo que se puede aceptar que el modelo no es por azar, al menos uno de los coeficientes parciales de regresión es distinto de 0. Muchos de ellos no son significativos, lo que es un indicativo de que podrían no contribuir al modelo.
step(object = modelo_l10muertes, direction = "both", trace = 1)
## Start: AIC=-188.14
## l10muertes.permil ~ Pobla80 + PoblaMid + PoblaData + PoblaDens +
## Mujeres + Urbano + DisMort + Lesion + Tuberculosis + Diabetes +
## ImmunSaramp + HipTen.M + BCG + Medicos + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - Lesion 1 0.00071 27.714 -190.14
## - PoblaData 1 0.00082 27.715 -190.14
## - Diabetes 1 0.00171 27.715 -190.13
## - Medicos 1 0.00208 27.716 -190.13
## - HipTen.M 1 0.06797 27.782 -189.80
## - DisMort 1 0.17974 27.893 -189.25
## - Mujeres 1 0.19268 27.906 -189.18
## <none> 27.714 -188.14
## - PoblaMid 1 0.57211 28.286 -187.30
## - PBI 1 0.65807 28.372 -186.88
## - TempMarzo 1 0.65876 28.372 -186.88
## - BCG 1 0.75002 28.464 -186.43
## - Tuberculosis 1 0.84134 28.555 -185.99
## - Urbano 1 0.84659 28.560 -185.96
## - PoblaDens 1 0.87098 28.585 -185.84
## - ImmunSaramp 1 0.89658 28.610 -185.72
## - Camas 1 2.20570 29.919 -179.50
## - Pobla80 1 2.66622 30.380 -177.38
##
## Step: AIC=-190.14
## l10muertes.permil ~ Pobla80 + PoblaMid + PoblaData + PoblaDens +
## Mujeres + Urbano + DisMort + Tuberculosis + Diabetes + ImmunSaramp +
## HipTen.M + BCG + Medicos + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - PoblaData 1 0.00079 27.715 -192.14
## - Diabetes 1 0.00157 27.716 -192.13
## - Medicos 1 0.00230 27.717 -192.13
## - HipTen.M 1 0.06828 27.783 -191.80
## - DisMort 1 0.17952 27.894 -191.24
## - Mujeres 1 0.20304 27.918 -191.13
## <none> 27.714 -190.14
## - PoblaMid 1 0.57359 28.288 -189.29
## - PBI 1 0.65765 28.372 -188.88
## - TempMarzo 1 0.66083 28.375 -188.87
## - BCG 1 0.74942 28.464 -188.43
## + Lesion 1 0.00071 27.714 -188.14
## - Urbano 1 0.86298 28.577 -187.88
## - Tuberculosis 1 0.87196 28.586 -187.84
## - ImmunSaramp 1 0.89703 28.611 -187.71
## - PoblaDens 1 0.92225 28.637 -187.59
## - Camas 1 2.20737 29.922 -181.49
## - Pobla80 1 2.80563 30.520 -178.74
##
## Step: AIC=-192.14
## l10muertes.permil ~ Pobla80 + PoblaMid + PoblaDens + Mujeres +
## Urbano + DisMort + Tuberculosis + Diabetes + ImmunSaramp +
## HipTen.M + BCG + Medicos + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - Diabetes 1 0.00176 27.717 -194.13
## - Medicos 1 0.00247 27.718 -194.12
## - HipTen.M 1 0.06820 27.783 -193.79
## - DisMort 1 0.18151 27.897 -193.23
## - Mujeres 1 0.20228 27.918 -193.13
## <none> 27.715 -192.14
## - PoblaMid 1 0.58776 28.303 -191.22
## - PBI 1 0.66055 28.376 -190.86
## - TempMarzo 1 0.67640 28.392 -190.78
## - BCG 1 0.75117 28.466 -190.42
## + PoblaData 1 0.00079 27.714 -190.14
## + Lesion 1 0.00069 27.715 -190.14
## - Urbano 1 0.86356 28.579 -189.87
## - Tuberculosis 1 0.87334 28.589 -189.82
## - ImmunSaramp 1 0.89671 28.612 -189.71
## - PoblaDens 1 0.92193 28.637 -189.59
## - Camas 1 2.22252 29.938 -183.41
## - Pobla80 1 2.82059 30.536 -180.66
##
## Step: AIC=-194.13
## l10muertes.permil ~ Pobla80 + PoblaMid + PoblaDens + Mujeres +
## Urbano + DisMort + Tuberculosis + ImmunSaramp + HipTen.M +
## BCG + Medicos + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - Medicos 1 0.00266 27.720 -196.11
## - HipTen.M 1 0.06659 27.784 -195.79
## - DisMort 1 0.18170 27.899 -195.22
## - Mujeres 1 0.20142 27.918 -195.12
## <none> 27.717 -194.13
## - PBI 1 0.66269 28.380 -192.84
## - TempMarzo 1 0.67814 28.395 -192.77
## - PoblaMid 1 0.73463 28.452 -192.49
## - BCG 1 0.75604 28.473 -192.39
## + Diabetes 1 0.00176 27.715 -192.14
## + PoblaData 1 0.00099 27.716 -192.13
## + Lesion 1 0.00054 27.716 -192.13
## - Urbano 1 0.86683 28.584 -191.85
## - ImmunSaramp 1 0.89496 28.612 -191.71
## - Tuberculosis 1 0.94198 28.659 -191.48
## - PoblaDens 1 0.95492 28.672 -191.42
## - Camas 1 2.24964 29.967 -185.28
## - Pobla80 1 2.82104 30.538 -182.66
##
## Step: AIC=-196.11
## l10muertes.permil ~ Pobla80 + PoblaMid + PoblaDens + Mujeres +
## Urbano + DisMort + Tuberculosis + ImmunSaramp + HipTen.M +
## BCG + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - HipTen.M 1 0.0645 27.784 -197.79
## - Mujeres 1 0.1995 27.919 -197.12
## - DisMort 1 0.2058 27.925 -197.09
## <none> 27.720 -196.11
## - PBI 1 0.6706 28.390 -194.79
## - TempMarzo 1 0.7302 28.450 -194.50
## - PoblaMid 1 0.7324 28.452 -194.49
## - BCG 1 0.7734 28.493 -194.29
## + Medicos 1 0.0027 27.717 -194.13
## + Diabetes 1 0.0019 27.718 -194.12
## + PoblaData 1 0.0012 27.718 -194.12
## + Lesion 1 0.0007 27.719 -194.12
## - ImmunSaramp 1 0.9355 28.655 -193.50
## - Tuberculosis 1 0.9509 28.671 -193.43
## - Urbano 1 0.9517 28.671 -193.42
## - PoblaDens 1 0.9526 28.672 -193.42
## - Camas 1 2.2508 29.971 -187.26
## - Pobla80 1 3.3617 31.081 -182.20
##
## Step: AIC=-197.79
## l10muertes.permil ~ Pobla80 + PoblaMid + PoblaDens + Mujeres +
## Urbano + DisMort + Tuberculosis + ImmunSaramp + BCG + Camas +
## PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - DisMort 1 0.1754 27.960 -198.92
## - Mujeres 1 0.2199 28.004 -198.69
## <none> 27.784 -197.79
## - PoblaMid 1 0.7011 28.485 -196.33
## - TempMarzo 1 0.7012 28.485 -196.33
## - PBI 1 0.7135 28.498 -196.27
## - BCG 1 0.7441 28.528 -196.12
## + HipTen.M 1 0.0645 27.720 -196.11
## + Lesion 1 0.0009 27.783 -195.80
## + PoblaData 1 0.0008 27.783 -195.79
## + Medicos 1 0.0006 27.784 -195.79
## + Diabetes 1 0.0002 27.784 -195.79
## - Tuberculosis 1 0.9140 28.698 -195.29
## - ImmunSaramp 1 0.9356 28.720 -195.19
## - Urbano 1 0.9817 28.766 -194.96
## - PoblaDens 1 1.0339 28.818 -194.71
## - Camas 1 2.1864 29.971 -189.26
## - Pobla80 1 3.8037 31.588 -181.96
##
## Step: AIC=-198.92
## l10muertes.permil ~ Pobla80 + PoblaMid + PoblaDens + Mujeres +
## Urbano + Tuberculosis + ImmunSaramp + BCG + Camas + PBI +
## TempMarzo
##
## Df Sum of Sq RSS AIC
## - Mujeres 1 0.2660 28.226 -199.60
## <none> 27.960 -198.92
## - PoblaMid 1 0.5907 28.550 -198.01
## - TempMarzo 1 0.6123 28.572 -197.91
## + DisMort 1 0.1754 27.784 -197.79
## - BCG 1 0.7648 28.724 -197.16
## + HipTen.M 1 0.0342 27.925 -197.09
## + Medicos 1 0.0183 27.941 -197.01
## + Diabetes 1 0.0037 27.956 -196.94
## + PoblaData 1 0.0031 27.956 -196.93
## + Lesion 1 0.0000 27.960 -196.92
## - ImmunSaramp 1 0.8268 28.786 -196.87
## - Tuberculosis 1 1.0010 28.961 -196.03
## - PoblaDens 1 1.0258 28.985 -195.91
## - PBI 1 1.0501 29.010 -195.79
## - Urbano 1 1.3864 29.346 -194.19
## - Camas 1 2.6052 30.565 -188.53
## - Pobla80 1 4.7997 32.759 -178.90
##
## Step: AIC=-199.6
## l10muertes.permil ~ Pobla80 + PoblaMid + PoblaDens + Urbano +
## Tuberculosis + ImmunSaramp + BCG + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - PoblaMid 1 0.3900 28.616 -199.69
## <none> 28.226 -199.60
## + Mujeres 1 0.2660 27.960 -198.92
## + DisMort 1 0.2216 28.004 -198.69
## - ImmunSaramp 1 0.7046 28.930 -198.17
## - TempMarzo 1 0.7356 28.961 -198.02
## - BCG 1 0.7631 28.989 -197.89
## + HipTen.M 1 0.0474 28.178 -197.83
## + Lesion 1 0.0253 28.200 -197.72
## - PBI 1 0.7993 29.025 -197.72
## + Medicos 1 0.0141 28.212 -197.67
## + Diabetes 1 0.0082 28.217 -197.64
## - PoblaDens 1 0.8225 29.048 -197.61
## + PoblaData 1 0.0009 28.225 -197.60
## - Tuberculosis 1 0.9039 29.129 -197.22
## - Urbano 1 1.4378 29.663 -194.69
## - Camas 1 2.4931 30.719 -189.84
## - Pobla80 1 7.4770 35.703 -168.94
##
## Step: AIC=-199.69
## l10muertes.permil ~ Pobla80 + PoblaDens + Urbano + Tuberculosis +
## ImmunSaramp + BCG + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## <none> 28.616 -199.69
## - ImmunSaramp 1 0.4246 29.040 -199.65
## + PoblaMid 1 0.3900 28.226 -199.60
## - BCG 1 0.6338 29.249 -198.65
## - PoblaDens 1 0.7271 29.343 -198.21
## + DisMort 1 0.0889 28.527 -198.12
## + Mujeres 1 0.0653 28.550 -198.01
## + Diabetes 1 0.0482 28.567 -197.93
## + Lesion 1 0.0301 28.585 -197.84
## + HipTen.M 1 0.0275 28.588 -197.83
## + PoblaData 1 0.0214 28.594 -197.80
## + Medicos 1 0.0052 28.610 -197.72
## - TempMarzo 1 0.8959 29.512 -197.41
## - Tuberculosis 1 0.9887 29.604 -196.97
## - PBI 1 1.2892 29.905 -195.57
## - Urbano 1 2.0146 30.630 -192.24
## - Camas 1 2.4039 31.019 -190.48
## - Pobla80 1 7.0903 35.706 -170.92
##
## Call:
## lm(formula = l10muertes.permil ~ Pobla80 + PoblaDens + Urbano +
## Tuberculosis + ImmunSaramp + BCG + Camas + PBI + TempMarzo,
## data = df_covid_l10muertes)
##
## Coefficients:
## (Intercept) Pobla80 PoblaDens Urbano Tuberculosis
## 1.3368035 0.1921847 -0.0113645 0.0077415 -0.0007509
## ImmunSaramp BCG Camas PBI TempMarzo
## -0.0049163 -0.3482976 -0.0906251 0.0065191 -0.0118475
El mejor modelo resultante del proceso de selección ha sido:
l10muertes_modelo <- (lm(formula = l10muertes.permil ~ Pobla80 + PoblaDens + Urbano + Tuberculosis + ImmunSaramp + BCG + Camas + PBI +TempMarzo,
data = df_covid_l10muertes))
summary(l10muertes_modelo)
##
## Call:
## lm(formula = l10muertes.permil ~ Pobla80 + PoblaDens + Urbano +
## Tuberculosis + ImmunSaramp + BCG + Camas + PBI + TempMarzo,
## data = df_covid_l10muertes)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.02072 -0.28370 -0.03759 0.27169 1.28314
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.3368035 0.4044392 3.305 0.00123 **
## Pobla80 0.1921847 0.0339934 5.654 9.63e-08 ***
## PoblaDens -0.0113645 0.0062769 -1.811 0.07254 .
## Urbano 0.0077415 0.0025688 3.014 0.00311 **
## Tuberculosis -0.0007509 0.0003557 -2.111 0.03669 *
## ImmunSaramp -0.0049163 0.0035536 -1.383 0.16891
## BCG -0.3482976 0.2060498 -1.690 0.09337 .
## Camas -0.0906251 0.0275296 -3.292 0.00128 **
## PBI 0.0065191 0.0027041 2.411 0.01733 *
## TempMarzo -0.0118475 0.0058951 -2.010 0.04655 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.471 on 129 degrees of freedom
## Multiple R-squared: 0.6381, Adjusted R-squared: 0.6128
## F-statistic: 25.27 on 9 and 129 DF, p-value: < 2.2e-16
Es recomendable mostrar el intervalo de confianza para cada uno de los coeficientes parciales de regresión:
confint(lm(formula = l10muertes.permil ~ Pobla80 + PoblaDens + Urbano + Tuberculosis + ImmunSaramp + BCG + Camas + PBI +TempMarzo,
data = df_covid_l10muertes))
## 2.5 % 97.5 %
## (Intercept) 0.536610663 2.136996e+00
## Pobla80 0.124927937 2.594414e-01
## PoblaDens -0.023783621 1.054536e-03
## Urbano 0.002658964 1.282398e-02
## Tuberculosis -0.001454553 -4.717712e-05
## ImmunSaramp -0.011947305 2.114653e-03
## BCG -0.755972208 5.937696e-02
## Camas -0.145093181 -3.615702e-02
## PBI 0.001168921 1.186925e-02
## TempMarzo -0.023511127 -1.837927e-04
Cada una de las pendientes de un modelo de regresión lineal múltiple (coeficientes parciales de regresión de los predictores) se define del siguiente modo: Si el resto de variables se mantienen constantes, por cada unidad que aumenta el predictor en cuestión, la variable (Y) varía en promedio tantas unidades como indica la pendiente. Para este ejemplo, por cada unidad que aumenta el predictor PBI, las muertes logaritmicas por mil de covid aumenta en promedio 0.065 unidades, manteniéndose constantes el resto de predictores.
Modelo considerando muertes.permil
df_covid_muertes.permil = data.frame(Pobla80,PoblaMid, PoblaData, PoblaDens, Mujeres, Urbano,DisMort, Lesion,Tuberculosis,Diabetes, ImmunSaramp,HipTen.M, BCG,Medicos,Camas,PBI,TempMarzo,muertes.permil)
df_covid_muertes.permil
## Pobla80 PoblaMid PoblaData PoblaDens Mujeres Urbano DisMort Lesion
## 1 0.2771541 54.32490 0.37172386 0.56937760 48.63585 25.495 29.8 19.5
## 2 2.7410163 68.58239 0.02866376 1.04612263 49.06309 60.319 17.0 4.0
## 3 1.2709846 63.48882 0.42228429 0.17730075 49.48427 72.629 14.2 9.5
## 4 0.2723907 50.97470 0.30809762 0.24713052 50.53046 65.514 16.5 9.2
## 5 2.6111754 64.12128 0.44494502 0.16258510 51.23735 91.870 15.8 6.5
## 6 3.1239347 68.11276 0.02951776 1.03680225 52.95658 63.149 22.3 3.9
## 7 4.0436339 65.15291 0.24992369 0.03249129 50.19962 86.012 9.1 5.9
## 8 5.2369767 66.70049 0.08847037 1.07206927 50.82943 58.297 11.4 5.2
## 9 1.3597424 70.43525 0.09942334 1.20265320 50.11575 55.680 22.2 4.6
## 10 0.9964088 67.13559 1.61356039 12.39579312 49.38730 36.632 21.6 7.5
## 11 3.8045048 68.28891 0.09485386 0.46728800 53.45605 78.595 23.7 7.0
## 12 5.6948380 64.15583 0.11422068 3.77214927 50.59332 98.001 11.4 6.4
## 13 1.0395255 64.98378 0.00383071 0.16793994 50.19252 45.724 22.1 13.2
## 14 0.4365651 54.29871 0.11485048 1.01853920 50.09820 47.312 19.6 10.2
## 15 1.2095158 68.22563 0.00754394 0.19777528 47.00264 40.895 23.3 10.5
## 16 1.6248620 61.73450 0.11353142 0.10480146 49.78340 69.425 17.2 13.1
## 17 3.3861895 68.76346 0.03323929 0.64920488 51.01054 48.245 17.8 3.7
## 18 0.4939442 61.66318 0.02254126 0.03977425 51.73076 69.446 20.3 8.3
## 19 1.8060280 69.74309 2.09469333 0.25061716 50.82992 86.569 16.6 12.2
## 20 0.7583938 72.10039 0.00428962 0.81396964 48.03618 77.629 16.6 7.4
## 21 4.7222857 64.38262 0.07024216 0.64703537 51.41409 75.008 23.6 2.6
## 22 0.2453268 52.64494 0.19751535 0.72191283 50.09548 29.358 21.7 11.0
## 23 0.2917947 52.25138 0.11175378 4.35178271 50.42199 13.032 22.9 12.1
## 24 0.5703887 64.22991 0.16249798 0.92056413 51.19798 23.388 21.1 10.0
## 25 0.3083562 54.63954 0.25216237 0.53343989 50.00349 56.374 21.6 10.9
## 26 4.3071336 66.89774 0.37058856 0.04075308 50.39153 81.411 9.8 6.1
## 27 0.3528256 52.87991 0.04666377 0.07490412 50.43647 41.364 23.1 10.3
## 28 1.7597254 68.44406 0.49648685 0.44748702 50.92577 80.778 15.8 15.0
## 29 0.3889863 57.45457 0.00832322 4.47244478 49.55870 28.965 22.9 10.9
## 30 0.2877278 55.55478 0.05244363 0.15356846 50.06560 66.916 16.7 9.9
## 31 5.5638202 65.04263 0.04089400 0.73077198 51.85262 56.947 16.7 5.3
## 32 4.0918014 64.99252 0.10625695 1.37602888 50.80859 73.792 15.0 4.7
## 33 4.5174188 63.72878 0.05797446 1.38067302 50.27420 87.874 11.3 3.8
## 34 0.6099089 65.89830 0.00958920 0.41368421 47.36679 77.777 19.6 10.4
## 35 1.5873319 64.94005 0.10627165 2.19978576 50.00780 81.074 19.0 12.0
## 36 1.5376442 64.81412 0.17084357 0.68788682 49.97063 63.821 13.0 12.8
## 37 0.7910340 60.97150 0.98423595 0.98873469 49.46997 42.704 27.7 5.8
## 38 1.8419292 64.58083 0.06420744 3.09881467 53.11400 72.023 14.0 15.4
## 39 0.2886712 60.42552 0.01308974 0.46665740 44.45585 72.143 22.0 10.7
## 40 5.5491132 64.01657 0.01320884 0.30386105 52.85843 68.880 17.0 4.5
## 41 0.5012502 55.71589 1.09224559 1.09224559 49.97889 20.763 18.3 11.7
## 42 0.5795601 65.03770 0.00883483 0.48357033 49.30050 56.248 30.6 5.4
## 43 5.4057724 62.13403 0.05518050 0.18156856 50.72076 85.382 10.2 5.5
## 44 6.1032258 62.00891 0.66987244 1.22338396 51.58424 80.444 10.6 6.4
## 45 0.5335561 59.41022 0.02119275 0.08224764 49.06862 89.370 14.4 9.1
## 46 0.2595557 53.14127 0.02280102 2.25306522 50.40213 61.270 20.4 10.9
## 47 3.6827447 65.33927 0.03731000 0.65275202 52.29124 58.632 24.9 3.6
## 48 6.6270801 64.91701 0.82927922 2.37370970 50.66037 77.312 12.1 4.0
## 49 0.3266130 59.33504 0.29767108 1.30821429 49.32583 56.060 20.8 9.8
## 50 7.2679122 64.27348 0.10727668 0.83224732 50.91620 79.058 12.4 2.9
## 51 1.0548473 60.75253 0.17247807 1.60953779 50.75935 51.054 14.9 15.7
## 52 0.3195615 53.22380 0.12414318 0.50522212 51.82111 36.140 22.4 9.2
## 53 1.2722362 65.33518 0.00779004 0.03957348 49.80802 26.606 30.5 12.4
## 54 0.8276328 61.80835 0.11123176 4.03598549 50.65221 55.278 26.5 12.6
## 55 1.0293956 63.56850 0.09587522 0.85687032 50.04934 57.096 14.0 19.6
## 56 4.2713096 66.43028 0.09768785 1.07906606 52.43243 71.351 23.0 4.4
## 57 0.3130915 50.39318 0.15477751 0.12291734 50.08490 23.059 23.9 9.3
## 58 2.7008155 68.71630 0.18729160 0.25189446 50.72703 87.564 12.4 7.1
## 59 1.7877871 71.20211 13.92730000 1.48348833 48.67937 59.152 17.0 7.0
## 60 0.9448065 66.76674 13.52617328 4.54938073 48.02354 34.030 23.3 11.3
## 61 0.8561815 67.59164 2.67663435 1.47752190 49.64388 55.325 26.4 6.0
## 62 1.1233084 69.33887 0.81800269 0.50222420 49.43913 74.898 14.8 10.1
## 63 0.4831038 58.28983 0.38433600 0.88530570 49.40868 70.473 21.3 28.4
## 64 3.0188525 64.72778 0.04853506 0.70452983 50.42551 63.170 10.3 4.3
## 65 3.0461867 60.09777 0.08883800 4.10526802 50.29813 92.418 9.6 4.1
## 66 7.1734357 63.91920 0.60431283 2.05450748 51.37667 70.438 9.5 3.8
## 67 2.0456797 67.45326 0.02934855 2.70993075 50.33983 55.674 14.7 8.7
## 68 8.3613475 59.72678 1.26529100 3.47073458 51.15926 91.616 8.4 4.8
## 69 0.6023762 61.90802 0.09956011 1.12142498 49.38968 90.979 19.2 10.9
## 70 1.4932044 64.14760 0.18276499 0.06769826 51.51148 57.428 26.8 9.5
## 71 0.2699139 57.87865 0.51393010 0.90299417 50.31602 27.030 13.4 9.6
## 72 0.2327419 75.91064 0.04137309 2.32172222 39.54817 100.000 17.4 12.8
## 73 5.5652960 63.96060 0.01926542 0.30983307 54.01017 68.142 21.9 5.4
## 74 1.4828557 66.90176 0.06848925 6.69494135 49.70581 88.593 17.9 5.8
## 75 0.8209008 62.38256 0.02108132 0.69437813 50.71690 28.153 26.6 8.3
## 76 0.3996440 55.62158 0.04818977 0.50030907 49.76829 51.151 17.6 10.0
## 77 0.7605248 67.28872 0.06678567 0.03795632 49.48379 80.102 20.1 20.1
## 78 5.8370281 65.41254 0.02789533 0.44531351 53.79196 67.679 20.7 6.6
## 79 4.0235270 69.93802 0.00607728 2.50093827 49.53926 90.981 10.0 6.7
## 80 0.4241700 56.34513 0.26262368 0.45139856 50.12397 37.191 22.9 10.6
## 81 0.3087382 53.45228 0.18143315 1.92440762 50.70152 16.937 16.4 8.6
## 82 1.0741699 69.33310 0.31528585 0.95962821 48.57852 76.036 17.2 8.9
## 83 0.2683715 49.94928 0.19077690 0.15635016 49.94100 42.356 24.6 8.9
## 84 0.4204185 56.77571 0.04403319 0.04272164 49.82266 53.672 18.1 9.4
## 85 2.0227961 70.73213 0.01265303 6.23301970 50.57711 40.793 22.6 4.8
## 86 1.5523039 66.21947 1.26190788 0.64914626 51.08928 80.156 15.7 10.3
## 87 2.2672524 72.67035 0.03545883 1.23519804 52.03556 42.629 24.9 5.7
## 88 0.6283914 65.50689 0.03170208 0.02040609 50.66954 68.445 30.2 10.6
## 89 3.4204855 66.81554 0.00622345 0.46271004 50.55901 66.813 20.6 3.5
## 90 1.1687236 65.78072 0.36029138 0.80728519 50.40385 62.453 12.4 6.4
## 91 0.3481273 52.43844 0.29495962 0.37508535 51.47519 35.988 18.4 7.8
## 92 0.7791075 67.84431 0.53708395 0.82238615 51.80790 30.579 24.2 8.6
## 93 0.6151794 59.45372 0.02448255 0.02973746 51.55369 50.032 21.3 9.8
## 94 0.7516195 63.85806 0.28087871 1.95939107 54.53534 19.740 21.8 8.8
## 95 4.6976392 64.69565 0.17231017 5.11457910 50.22094 91.490 11.2 5.2
## 96 3.7311137 64.69414 0.04885500 0.18554176 50.83777 86.538 10.1 6.0
## 97 1.1025688 64.55082 0.06465513 0.53727048 50.71271 58.522 14.2 12.7
## 98 0.2340882 47.42067 0.22442948 0.17717651 49.77100 16.425 20.0 10.4
## 99 4.2231531 65.40174 0.05314336 0.14554920 49.52463 82.248 9.2 5.6
## 100 0.4596337 75.36071 0.04829483 0.15604145 34.01408 84.539 17.8 17.7
## 101 0.6545620 60.41741 2.12215030 2.75289319 48.53807 36.666 24.7 7.3
## 102 1.9205337 64.83296 0.04176873 0.56186077 49.90538 67.709 13.0 9.7
## 103 1.2135437 64.12928 0.06956071 0.17508359 49.15161 61.585 17.5 12.0
## 104 1.6809015 66.12100 0.31989256 0.24991606 50.33776 77.907 12.6 10.5
## 105 0.7893793 63.91439 1.06651922 3.57688305 49.74166 46.907 26.8 7.5
## 106 4.4631164 67.42991 0.37978548 1.24035886 51.53071 60.058 18.7 4.7
## 107 6.3408699 64.58823 0.10281762 1.12239454 52.71196 65.211 11.1 4.2
## 108 0.1847213 85.08917 0.02781677 2.39593196 24.49529 99.135 15.3 25.9
## 109 4.7084438 66.12674 0.19473936 0.84639847 51.34374 53.998 21.4 3.6
## 110 0.3624706 57.08623 0.12301939 4.98659870 50.86106 17.211 18.2 13.5
## 111 2.4482249 67.86891 0.00110210 2.82589744 49.20878 52.198 23.2 5.6
## 112 0.5038453 71.64306 0.33699947 0.15676654 42.44585 83.844 16.4 16.3
## 113 0.3825330 53.85775 0.15854360 0.82347478 51.27733 47.192 18.1 12.2
## 114 4.0191136 65.96453 0.06982084 0.79831740 51.00252 56.092 19.1 3.0
## 115 0.3522140 55.97380 0.07650154 1.05987171 50.12127 42.055 30.5 8.9
## 116 2.1766595 76.25834 0.05638676 79.52998418 47.65813 100.000 9.3 3.7
## 117 3.2223629 68.92462 0.05447011 1.13290578 51.33833 53.726 17.2 6.0
## 118 5.3152643 65.37135 0.02067372 1.02639860 50.24521 54.541 12.7 6.6
## 119 0.7184723 65.60251 0.57779622 0.47630120 50.69415 66.355 26.2 9.1
## 120 3.2120425 72.60812 0.51635256 5.29652104 49.91688 81.459 7.8 10.0
## 121 6.1672057 65.95449 0.46723749 0.93529058 50.89664 80.321 9.9 3.5
## 122 1.6065781 65.32978 0.21670000 3.45558922 51.96682 18.476 17.4 9.7
## 123 5.1726032 62.32269 0.10183175 0.25001043 49.94578 87.431 9.1 4.9
## 124 5.1493834 66.46583 0.08516543 2.15521378 50.42712 73.797 8.6 6.1
## 125 0.5234433 60.19383 0.09100837 0.65572714 49.58384 27.134 25.3 7.6
## 126 2.5315654 71.01212 0.69428524 1.35897207 51.26870 49.949 14.5 10.2
## 127 0.2700138 55.79601 0.07889094 1.45046773 50.26805 41.702 23.6 10.7
## 128 1.7197442 67.51420 0.11565204 0.74441323 50.43715 68.945 16.1 6.4
## 129 1.6774797 66.86738 0.82319724 1.06960129 50.67781 75.143 16.1 6.2
## 130 0.2057545 51.12849 0.42723139 2.13061734 50.77608 23.774 21.9 12.7
## 131 3.9876216 67.75290 0.44622516 0.77029667 53.68775 69.352 24.7 5.0
## 132 0.1307769 84.31149 0.09630959 1.35609110 30.63669 86.522 16.8 16.8
## 133 5.0282090 63.92605 0.66488991 2.74827392 50.63527 83.398 10.9 3.5
## 134 3.8751036 65.48331 3.27167434 0.35766089 50.52001 82.256 14.6 6.6
## 135 4.3947641 64.57750 0.03449299 0.19708028 51.72154 95.334 16.7 7.5
## 136 0.8369038 66.89480 0.32955400 0.77469205 50.13736 50.478 24.5 6.0
## 137 0.3498816 57.50884 0.28498687 0.53977853 49.61166 36.642 30.6 14.7
## 138 0.2529708 52.96418 0.17351822 0.23341479 50.49321 43.521 17.9 10.2
## 139 0.4222739 54.65941 0.14439018 0.37324591 52.35675 32.209 19.3 12.3
## Tuberculosis Diabetes ImmunSaramp HipTen.M BCG Medicos Camas
## 1 189.0 9.2 64 19.8 1 0.24009091 0.4363636
## 2 18.0 9.0 94 39.4 1 1.21237143 2.9375000
## 3 69.0 6.7 80 23.0 1 1.31202500 1.9000000
## 4 355.0 4.5 50 25.2 1 0.17300000 0.8000000
## 5 27.0 5.9 94 32.9 1 3.57165000 4.6000000
## 6 31.0 6.1 95 43.4 1 3.06122500 4.0200000
## 7 6.6 5.6 95 32.8 1 3.27402222 3.8783333
## 8 7.1 6.6 94 38.8 1 4.66801111 7.7000000
## 9 63.0 6.1 96 31.4 1 3.58736250 6.4666667
## 10 221.0 9.2 97 17.4 1 0.39047692 0.5750000
## 11 31.0 5.0 97 45.5 1 4.22154000 11.2000000
## 12 9.0 4.6 96 35.0 0 2.79814444 6.5500000
## 13 30.0 17.1 97 25.1 1 0.96785000 1.1600000
## 14 56.0 1.0 71 40.3 1 0.11874000 0.5000000
## 15 149.0 10.3 97 20.4 1 0.26431111 1.7333333
## 16 108.0 6.8 89 27.2 1 0.71612500 1.1000000
## 17 25.0 9.0 68 43.2 1 1.77503333 3.3666667
## 18 275.0 5.8 97 41.0 1 0.35774444 2.0000000
## 19 45.0 10.4 84 38.5 1 1.84654000 2.3285714
## 20 68.0 13.3 99 32.0 1 1.38302727 2.7542857
## 21 22.0 6.0 93 46.5 1 3.80887500 6.4888889
## 22 48.0 7.3 88 12.4 1 0.04237143 0.6500000
## 23 111.0 5.1 88 30.8 1 0.04885000 1.1333333
## 24 302.0 6.4 84 24.1 1 0.24971429 0.7600000
## 25 186.0 6.0 71 17.9 1 0.07534000 1.4000000
## 26 5.6 7.6 90 23.9 0 2.32944444 3.0714286
## 27 540.0 6.0 49 33.2 1 0.04973333 1.1000000
## 28 33.0 7.4 95 28.7 1 1.70129231 1.3166667
## 29 35.0 12.3 90 41.5 1 0.18323333 2.2000000
## 30 375.0 6.0 75 19.3 1 0.12880000 1.6000000
## 31 8.4 5.4 93 38.5 1 2.80697000 5.6354545
## 32 5.4 7.0 96 42.6 1 3.70292500 7.0100000
## 33 5.4 8.3 95 34.6 1 3.56958333 3.4111111
## 34 260.0 5.1 86 22.3 1 0.21512500 1.4571429
## 35 45.0 8.6 95 29.3 1 1.37733333 1.4375000
## 36 44.0 5.5 83 28.6 1 1.90360000 1.5285714
## 37 12.0 17.2 94 23.9 1 1.73048750 1.5100000
## 38 70.0 8.8 81 30.0 1 1.65428000 0.9900000
## 39 201.0 6.0 30 25.2 1 0.40000000 2.0666667
## 40 13.0 4.2 87 42.9 1 3.34070000 5.3600000
## 41 151.0 4.3 61 22.2 1 0.03620000 1.7500000
## 42 54.0 14.7 94 25.0 1 0.58042000 2.1475000
## 43 4.7 5.6 96 46.6 1 3.14394000 5.9600000
## 44 8.9 4.8 90 38.5 1 3.26508571 6.9222222
## 45 525.0 6.0 59 43.6 1 0.36110000 3.2000000
## 46 174.0 1.9 91 30.4 1 0.09858333 1.0000000
## 47 80.0 5.8 98 41.0 1 4.62520000 3.1222222
## 48 7.3 10.4 97 34.2 1 3.84022000 8.2555556
## 49 148.0 2.5 92 41.4 1 0.12015714 0.9000000
## 50 4.5 4.7 97 36.4 1 5.71011111 4.6555556
## 51 26.0 10.0 87 26.5 1 0.62945000 0.6250000
## 52 176.0 2.4 48 41.0 1 0.09196667 0.3000000
## 53 83.0 11.6 98 26.3 1 0.56823333 2.1600000
## 54 176.0 6.7 69 26.7 1 0.18585000 1.0000000
## 55 37.0 7.3 89 25.7 1 0.57160000 0.7285714
## 56 6.4 6.9 99 47.4 1 3.24861667 7.3000000
## 57 142.0 6.0 37 31.3 1 0.04200000 0.4000000
## 58 18.0 8.6 93 28.2 1 1.03645000 2.1714286
## 59 61.0 9.2 99 32.3 1 1.57320000 3.4066667
## 60 199.0 10.4 90 29.2 1 0.67390833 0.8000000
## 61 316.0 6.3 75 24.7 1 0.24655000 0.9000000
## 62 14.0 9.6 99 25.9 1 0.98516000 1.4400000
## 63 42.0 8.8 83 23.9 1 0.72533333 1.3100000
## 64 7.0 3.2 92 32.2 1 2.81283000 3.9555556
## 65 4.0 9.7 98 40.1 1 3.38105556 3.5333333
## 66 7.0 5.0 93 36.5 0 3.94927778 3.6875000
## 67 2.9 11.3 89 33.6 1 0.54227143 1.7571429
## 68 14.0 5.6 97 37.5 1 2.27806667 13.7960000
## 69 5.0 12.7 92 26.3 1 2.24923636 1.7818182
## 70 68.0 6.1 99 33.1 1 3.60587000 7.4111111
## 71 292.0 3.1 89 36.8 1 0.18122857 1.4000000
## 72 23.0 12.2 99 26.5 1 2.16873636 1.9800000
## 73 29.0 5.0 98 36.7 1 3.38225000 6.8111111
## 74 11.0 11.2 82 29.6 0 2.55344444 3.3800000
## 75 611.0 4.5 90 35.0 1 0.06760000 1.3000000
## 76 308.0 2.4 91 40.3 1 0.02466667 0.7500000
## 77 40.0 10.2 97 23.6 1 1.98748333 3.6700000
## 78 44.0 3.8 92 40.5 1 4.08613000 7.1666667
## 79 8.0 5.0 99 37.1 1 2.85313000 5.3727273
## 80 233.0 4.5 62 32.2 1 0.17360000 0.2500000
## 81 181.0 4.5 87 32.6 1 0.01767500 1.2000000
## 82 92.0 16.7 96 25.2 1 1.24358000 1.8312500
## 83 53.0 2.4 70 32.1 1 0.09575714 0.3333333
## 84 93.0 7.1 78 29.5 1 0.14066667 0.4000000
## 85 13.0 22.0 99 48.4 1 1.45775556 3.2333333
## 86 23.0 13.5 97 28.5 1 2.03156667 1.5888889
## 87 86.0 5.7 93 42.2 1 2.62560000 6.1666667
## 88 428.0 4.7 99 30.6 1 2.96358889 6.3266667
## 89 15.0 9.0 58 41.9 1 2.08927778 4.0125000
## 90 99.0 7.0 99 33.0 1 0.63655000 0.9800000
## 91 551.0 3.3 85 31.5 1 0.04688750 0.7666667
## 92 338.0 3.9 93 25.5 1 0.53712000 0.7500000
## 93 524.0 4.5 82 41.9 1 0.37305000 3.0000000
## 94 151.0 7.2 91 22.1 1 0.57297500 2.6500000
## 95 5.3 5.4 93 33.8 0 3.40828889 4.6000000
## 96 7.3 6.2 92 30.9 1 2.70726000 2.5500000
## 97 41.0 11.4 99 26.2 1 0.74390000 0.9222222
## 98 87.0 2.4 77 32.4 1 0.03340000 0.3000000
## 99 4.1 5.3 96 33.0 1 4.21626667 4.2555556
## 100 5.9 10.1 99 26.2 1 1.95183077 1.8600000
## 101 265.0 19.9 76 21.1 1 0.84727500 0.7200000
## 102 52.0 7.7 98 24.6 1 1.43397000 2.2888889
## 103 43.0 9.6 93 27.2 1 0.96393333 1.2857143
## 104 123.0 6.6 85 17.8 1 1.18280000 1.4875000
## 105 554.0 7.1 67 23.5 1 1.25186667 0.5833333
## 106 16.0 6.1 93 35.0 1 2.19399000 6.5222222
## 107 24.0 9.8 99 35.7 1 3.79097273 3.4222222
## 108 31.0 15.6 99 36.2 1 2.47302500 1.6400000
## 109 68.0 6.9 90 46.7 1 2.40146667 6.4555556
## 110 59.0 5.1 99 30.4 1 0.09168889 1.6000000
## 111 6.3 11.6 99 30.7 1 0.65870000 3.3000000
## 112 10.0 15.8 98 27.0 1 2.25626250 2.2500000
## 113 118.0 2.4 82 40.4 1 0.14020000 0.2000000
## 114 17.0 9.0 92 41.6 1 2.42901111 5.6125000
## 115 298.0 2.4 80 39.7 1 0.02050000 0.4000000
## 116 47.0 5.5 95 22.1 1 1.76859091 2.7457143
## 117 5.8 6.5 96 33.7 1 3.11790000 6.3400000
## 118 5.3 5.9 93 37.2 1 2.59476000 4.6555556
## 119 520.0 12.7 70 45.9 1 0.76988750 2.8000000
## 120 66.0 6.9 98 23.5 1 2.05984615 10.6080000
## 121 9.4 6.9 97 37.1 1 4.15920000 3.1888889
## 122 64.0 10.7 99 25.8 1 0.77147000 3.5500000
## 123 5.5 4.8 97 37.0 0 4.03310000 2.7666667
## 124 6.4 5.7 96 31.7 1 4.00455000 5.1222222
## 125 84.0 6.1 98 25.4 1 1.78443333 5.2666667
## 126 153.0 7.0 96 23.8 1 0.40473333 2.1000000
## 127 36.0 2.4 85 40.1 1 0.08897500 0.8000000
## 128 35.0 8.5 96 25.2 1 1.16097143 2.0545455
## 129 16.0 11.1 96 35.1 1 1.65210000 2.4555556
## 130 200.0 2.5 86 32.7 1 0.10457500 0.7500000
## 131 80.0 6.1 91 50.6 1 3.35196667 8.9222222
## 132 1.0 16.3 99 19.2 1 1.70489167 1.6777778
## 133 8.0 3.9 92 29.9 1 2.75287500 3.2111111
## 134 3.0 10.8 92 31.8 0 2.52747500 3.0333333
## 135 33.0 7.3 97 38.8 1 4.16766000 2.5250000
## 136 70.0 6.5 96 27.7 1 2.50781250 4.5888889
## 137 48.0 5.4 64 12.4 1 0.30986667 0.6900000
## 138 346.0 4.5 94 27.4 1 0.08791250 1.9500000
## 139 210.0 1.8 88 32.0 1 0.06561250 2.3500000
## PBI TempMarzo muertes.permil
## 1 1.8351696 7.60 6.10668360
## 2 11.3351950 6.04 11.51279525
## 3 14.1967389 17.91 14.75309441
## 4 6.7205961 22.78 0.12982898
## 5 20.0684923 17.51 11.23734344
## 6 8.3491802 -0.57 33.20035125
## 7 45.7525548 25.37 4.12125797
## 8 48.9687140 1.42 72.90576495
## 9 17.0906963 4.97 5.43132025
## 10 3.3061083 25.42 3.37142634
## 11 18.1721809 -0.69 22.56102177
## 12 45.2631622 5.23 819.81651659
## 13 8.0937796 24.45 5.22096426
## 14 2.0675705 30.14 0.26120918
## 15 8.3417246 5.68 0.00000000
## 16 6.5317860 22.07 24.66277617
## 17 11.6971771 4.01 45.42816649
## 18 16.1336867 24.30 0.44363092
## 19 15.5847506 25.49 122.20404597
## 20 80.8004129 25.92 4.66241765
## 21 17.9465777 4.70 18.93449746
## 22 1.6709928 30.63 2.68333575
## 23 0.7568378 20.43 0.08948243
## 24 3.3333517 27.93 0.00000000
## 25 3.2930885 26.27 7.01928682
## 26 44.2264907 -18.72 182.54745910
## 27 0.8532664 26.96 0.21429902
## 28 13.2116325 25.14 16.17364085
## 29 2.6420144 25.20 2.40291618
## 30 5.6636489 25.60 3.62293762
## 31 22.9922117 5.83 24.69799971
## 32 32.7718057 2.80 29.83334267
## 33 48.5249925 2.24 97.45670766
## 34 2.7442687 25.75 18.77111751
## 35 13.9050879 22.88 44.60267625
## 36 10.8759023 21.93 191.69583028
## 37 10.8110341 17.83 8.29069493
## 38 7.2348467 25.70 6.07406245
## 39 30.5908474 25.04 9.16748537
## 40 28.8340001 -2.35 49.96653756
## 41 1.5126247 23.48 0.05493270
## 42 8.8754441 25.00 0.00000000
## 43 42.8552430 -6.09 56.72293654
## 44 40.3515680 6.37 426.88724438
## 45 17.0778163 26.14 6.60603272
## 46 2.4051919 27.32 0.43857687
## 47 9.5834608 0.72 3.21629590
## 48 46.5762068 3.87 101.42542822
## 49 3.9219764 29.52 1.14220031
## 50 27.2065489 8.19 16.12652442
## 51 7.5159291 22.94 3.94253020
## 52 2.0022876 27.63 1.69159514
## 53 7.1987245 25.65 14.12059502
## 54 1.7058976 23.47 3.05668093
## 55 4.4336960 23.38 20.23463414
## 56 25.7573736 5.44 52.10473974
## 57 2.0073216 26.55 4.13496767
## 58 22.2523960 10.87 44.90324179
## 59 13.5313781 0.49 3.33015014
## 60 5.8366566 23.45 3.34980183
## 61 10.5772045 25.79 5.50317977
## 62 18.4501839 11.33 92.46913357
## 63 15.8895142 15.12 4.55330752
## 64 59.3055780 6.00 336.04573683
## 65 34.5710854 14.96 31.63060852
## 66 37.7630816 6.52 547.26622303
## 67 8.5085469 23.44 3.06659102
## 68 39.1530060 2.52 6.78104879
## 69 9.2014965 13.08 0.90397650
## 70 24.1030338 -3.96 2.02445775
## 71 2.8839337 26.10 1.07018445
## 72 75.8307296 19.23 42.29802512
## 73 23.8146826 -1.37 11.93848875
## 74 13.2450688 10.39 3.79621619
## 75 2.9043623 15.13 0.00000000
## 76 1.2563111 26.44 5.60284890
## 77 19.3396159 17.76 0.59893088
## 78 27.8087523 -0.47 23.65987425
## 79 100.2191161 4.70 181.00202722
## 80 1.7044431 23.99 0.07615460
## 81 1.1836484 23.25 0.22046688
## 82 25.8714034 25.19 3.64748370
## 83 2.0131236 27.34 3.66920733
## 84 3.8172107 25.29 3.63362273
## 85 19.3987280 25.48 7.90324531
## 86 17.8555895 18.44 68.12700147
## 87 5.8933274 2.93 77.27271317
## 88 11.1277975 -8.80 0.00000000
## 89 16.2734892 2.53 14.46143216
## 90 7.4795258 13.09 5.60657321
## 91 1.2616857 25.48 0.03390295
## 92 5.0214146 22.74 0.11171438
## 93 10.2230967 22.67 0.00000000
## 94 2.4752041 10.02 0.14241022
## 95 49.9843155 4.95 340.72277916
## 96 36.4995043 13.60 4.50312148
## 97 4.8837325 24.95 5.41333688
## 98 0.9278714 26.01 2.85167528
## 99 62.6503184 -5.49 44.22001168
## 100 42.4790524 23.40 7.86833705
## 101 4.6501098 16.01 5.93737399
## 102 20.8839055 25.44 75.41526879
## 103 11.4029323 25.84 1.58135246
## 104 12.3515166 19.99 124.51055442
## 105 7.0082665 25.13 8.47617167
## 106 25.9904310 2.65 27.06791213
## 107 29.3390041 11.33 131.88400976
## 108 123.2139364 21.78 10.78486107
## 109 21.6182719 3.40 62.59648794
## 110 1.7889788 19.25 0.00000000
## 111 10.9317631 25.90 0.00000000
## 112 51.5878305 20.60 12.61129580
## 113 3.1310271 28.47 2.45989116
## 114 14.9080484 4.91 34.37369129
## 115 1.4959394 27.65 5.88223453
## 116 86.0684237 28.62 4.07897173
## 117 29.0915206 2.40 5.14043390
## 118 31.7402860 3.38 51.75652955
## 119 12.8666891 21.10 9.55354121
## 120 34.6370853 3.66 5.20961879
## 121 34.5888453 8.60 580.39007101
## 122 11.1185327 27.03 0.46146747
## 123 47.6285919 -4.98 414.40906201
## 124 61.3146089 0.09 193.38832670
## 125 2.7293337 -3.08 5.05448015
## 126 15.8571484 27.38 0.82098822
## 127 1.4956789 29.31 1.64784448
## 128 11.2660561 14.21 4.15038075
## 129 23.5212137 4.77 53.41368734
## 130 1.8103287 23.68 0.00000000
## 131 8.4417522 1.18 14.43217590
## 132 65.5180899 22.61 26.47711407
## 133 41.1611271 4.66 563.40154117
## 134 55.0581658 0.06 307.00488362
## 135 20.4797528 21.26 6.37810755
## 136 6.8361061 5.38 0.42481657
## 137 3.5314239 20.82 1.85973480
## 138 3.8025013 22.90 0.40341585
## 139 2.5606953 22.92 0.27702715
modelo_muertes.permil<-lm(muertes.permil~.,data = df_covid_muertes.permil)
summary(modelo_muertes.permil)
##
## Call:
## lm(formula = muertes.permil ~ ., data = df_covid_muertes.permil)
##
## Residuals:
## Min 1Q Median 3Q Max
## -215.02 -26.08 -7.73 11.31 429.15
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.910e+02 2.749e+02 0.695 0.48849
## Pobla80 2.962e+01 9.338e+00 3.172 0.00192 **
## PoblaMid -2.665e-01 2.160e+00 -0.123 0.90202
## PoblaData 1.687e+00 4.801e+00 0.351 0.72590
## PoblaDens -1.911e+00 1.323e+00 -1.445 0.15111
## Mujeres 1.955e+00 3.920e+00 0.499 0.61884
## Urbano 2.183e-02 5.847e-01 0.037 0.97029
## DisMort -6.788e-01 2.236e+00 -0.304 0.76200
## Lesion -1.842e-01 2.676e+00 -0.069 0.94525
## Tuberculosis 9.083e-03 7.387e-02 0.123 0.90234
## Diabetes -4.035e+00 2.714e+00 -1.487 0.13972
## ImmunSaramp 2.805e-01 7.732e-01 0.363 0.71744
## HipTen.M -9.491e-01 1.228e+00 -0.773 0.44095
## BCG -2.423e+02 4.055e+01 -5.975 2.38e-08 ***
## Medicos -3.388e+00 1.285e+01 -0.264 0.79256
## Camas -1.097e+01 5.586e+00 -1.963 0.05191 .
## PBI 1.470e+00 7.395e-01 1.988 0.04904 *
## TempMarzo 4.740e-01 1.269e+00 0.374 0.70936
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 90.85 on 121 degrees of freedom
## Multiple R-squared: 0.5449, Adjusted R-squared: 0.481
## F-statistic: 8.524 on 17 and 121 DF, p-value: 6.558e-14
El modelo con todas las variables introducidas como predictores tiene un \(R^2\) alta (0.5449), es capaz de explicar el 55% de la variabilidad observada en la muertes logarimicas por mil de covid. El p-value del modelo es significativo (6.55e-13) por lo que se puede aceptar que el modelo no es por azar, al menos uno de los coeficientes parciales de regresión es distinto de 0. Muchos de ellos no son significativos, lo que es un indicativo de que podrían no contribuir al modelo.
step(object = modelo_muertes.permil, direction = "both", trace = 1)
## Start: AIC=1270.28
## muertes.permil ~ Pobla80 + PoblaMid + PoblaData + PoblaDens +
## Mujeres + Urbano + DisMort + Lesion + Tuberculosis + Diabetes +
## ImmunSaramp + HipTen.M + BCG + Medicos + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - Urbano 1 11 998704 1268.3
## - Lesion 1 39 998732 1268.3
## - Tuberculosis 1 125 998817 1268.3
## - PoblaMid 1 126 998818 1268.3
## - Medicos 1 573 999266 1268.4
## - DisMort 1 760 999453 1268.4
## - PoblaData 1 1019 999712 1268.4
## - ImmunSaramp 1 1086 999779 1268.4
## - TempMarzo 1 1152 999845 1268.4
## - Mujeres 1 2053 1000746 1268.6
## - HipTen.M 1 4933 1003626 1269.0
## <none> 998693 1270.3
## - PoblaDens 1 17228 1015921 1270.7
## - Diabetes 1 18241 1016934 1270.8
## - Camas 1 31814 1030506 1272.6
## - PBI 1 32627 1031319 1272.8
## - Pobla80 1 83040 1081732 1279.4
## - BCG 1 294672 1293364 1304.2
##
## Step: AIC=1268.28
## muertes.permil ~ Pobla80 + PoblaMid + PoblaData + PoblaDens +
## Mujeres + DisMort + Lesion + Tuberculosis + Diabetes + ImmunSaramp +
## HipTen.M + BCG + Medicos + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - Lesion 1 35 998739 1266.3
## - PoblaMid 1 114 998818 1266.3
## - Tuberculosis 1 130 998834 1266.3
## - Medicos 1 591 999295 1266.4
## - DisMort 1 965 999669 1266.4
## - PoblaData 1 1009 999713 1266.4
## - ImmunSaramp 1 1083 999787 1266.4
## - TempMarzo 1 1217 999921 1266.5
## - Mujeres 1 2058 1000762 1266.6
## - HipTen.M 1 4922 1003626 1267.0
## <none> 998704 1268.3
## - PoblaDens 1 17240 1015944 1268.7
## - Diabetes 1 18236 1016940 1268.8
## + Urbano 1 11 998693 1270.3
## - Camas 1 32001 1030705 1270.7
## - PBI 1 33273 1031977 1270.8
## - Pobla80 1 83637 1082341 1277.5
## - BCG 1 304782 1303486 1303.3
##
## Step: AIC=1266.29
## muertes.permil ~ Pobla80 + PoblaMid + PoblaData + PoblaDens +
## Mujeres + DisMort + Tuberculosis + Diabetes + ImmunSaramp +
## HipTen.M + BCG + Medicos + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - PoblaMid 1 106 998845 1264.3
## - Tuberculosis 1 156 998895 1264.3
## - Medicos 1 580 999319 1264.4
## - DisMort 1 954 999693 1264.4
## - PoblaData 1 1018 999757 1264.4
## - ImmunSaramp 1 1068 999807 1264.4
## - TempMarzo 1 1186 999925 1264.5
## - Mujeres 1 2421 1001160 1264.6
## - HipTen.M 1 4982 1003721 1265.0
## <none> 998739 1266.3
## - PoblaDens 1 17714 1016453 1266.7
## - Diabetes 1 18210 1016949 1266.8
## + Lesion 1 35 998704 1268.3
## + Urbano 1 7 998732 1268.3
## - Camas 1 32259 1030998 1268.7
## - PBI 1 33269 1032008 1268.8
## - Pobla80 1 90262 1089001 1276.3
## - BCG 1 305105 1303844 1301.3
##
## Step: AIC=1264.3
## muertes.permil ~ Pobla80 + PoblaData + PoblaDens + Mujeres +
## DisMort + Tuberculosis + Diabetes + ImmunSaramp + HipTen.M +
## BCG + Medicos + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - Tuberculosis 1 138 998983 1262.3
## - Medicos 1 678 999523 1262.4
## - PoblaData 1 959 999804 1262.4
## - DisMort 1 960 999805 1262.4
## - ImmunSaramp 1 962 999807 1262.4
## - TempMarzo 1 1261 1000106 1262.5
## - Mujeres 1 2973 1001818 1262.7
## - HipTen.M 1 4942 1003787 1263.0
## <none> 998845 1264.3
## - PoblaDens 1 19045 1017890 1264.9
## - Diabetes 1 23371 1022216 1265.5
## + PoblaMid 1 106 998739 1266.3
## + Lesion 1 27 998818 1266.3
## + Urbano 1 0 998845 1266.3
## - Camas 1 33023 1031868 1266.8
## - PBI 1 33227 1032072 1266.8
## - Pobla80 1 90217 1089062 1274.3
## - BCG 1 308747 1307592 1299.7
##
## Step: AIC=1262.32
## muertes.permil ~ Pobla80 + PoblaData + PoblaDens + Mujeres +
## DisMort + Diabetes + ImmunSaramp + HipTen.M + BCG + Medicos +
## Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - Medicos 1 788 999771 1260.4
## - ImmunSaramp 1 859 999842 1260.4
## - DisMort 1 870 999854 1260.4
## - PoblaData 1 1030 1000014 1260.5
## - TempMarzo 1 1307 1000291 1260.5
## - Mujeres 1 3117 1002101 1260.8
## - HipTen.M 1 4846 1003829 1261.0
## <none> 998983 1262.3
## - PoblaDens 1 19207 1018191 1263.0
## - Diabetes 1 25486 1024469 1263.8
## + Tuberculosis 1 138 998845 1264.3
## + PoblaMid 1 89 998895 1264.3
## + Lesion 1 49 998935 1264.3
## + Urbano 1 1 998983 1264.3
## - Camas 1 32885 1031869 1264.8
## - PBI 1 33719 1032703 1264.9
## - Pobla80 1 91392 1090376 1272.5
## - BCG 1 308931 1307914 1297.8
##
## Step: AIC=1260.43
## muertes.permil ~ Pobla80 + PoblaData + PoblaDens + Mujeres +
## DisMort + Diabetes + ImmunSaramp + HipTen.M + BCG + Camas +
## PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - ImmunSaramp 1 580 1000351 1258.5
## - DisMort 1 1098 1000869 1258.6
## - PoblaData 1 1202 1000974 1258.6
## - TempMarzo 1 2274 1002045 1258.8
## - Mujeres 1 3163 1002934 1258.9
## - HipTen.M 1 5297 1005068 1259.2
## <none> 999771 1260.4
## - PoblaDens 1 18833 1018605 1261.0
## - Diabetes 1 26348 1026119 1262.0
## + Medicos 1 788 998983 1262.3
## + Tuberculosis 1 248 999523 1262.4
## + PoblaMid 1 182 999589 1262.4
## + Urbano 1 93 999678 1262.4
## + Lesion 1 37 999734 1262.4
## - PBI 1 33286 1033057 1263.0
## - Camas 1 33447 1033219 1263.0
## - Pobla80 1 105611 1105382 1272.4
## - BCG 1 311890 1311662 1296.2
##
## Step: AIC=1258.51
## muertes.permil ~ Pobla80 + PoblaData + PoblaDens + Mujeres +
## DisMort + Diabetes + HipTen.M + BCG + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - PoblaData 1 1248 1001599 1256.7
## - DisMort 1 1427 1001777 1256.7
## - TempMarzo 1 2054 1002405 1256.8
## - Mujeres 1 3220 1003571 1257.0
## - HipTen.M 1 5380 1005731 1257.3
## <none> 1000351 1258.5
## - PoblaDens 1 18552 1018903 1259.1
## - Diabetes 1 26218 1026569 1260.1
## + ImmunSaramp 1 580 999771 1260.4
## + Medicos 1 508 999842 1260.4
## + Urbano 1 112 1000239 1260.5
## + Tuberculosis 1 100 1000251 1260.5
## + Lesion 1 25 1000326 1260.5
## + PoblaMid 1 19 1000332 1260.5
## - Camas 1 32874 1033224 1261.0
## - PBI 1 33672 1034023 1261.1
## - Pobla80 1 105663 1106014 1270.5
## - BCG 1 311622 1311973 1294.2
##
## Step: AIC=1256.69
## muertes.permil ~ Pobla80 + PoblaDens + Mujeres + DisMort + Diabetes +
## HipTen.M + BCG + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - DisMort 1 1527 1003126 1254.9
## - TempMarzo 1 1698 1003296 1254.9
## - Mujeres 1 2939 1004537 1255.1
## - HipTen.M 1 5453 1007051 1255.4
## <none> 1001599 1256.7
## - PoblaDens 1 17889 1019488 1257.2
## - Diabetes 1 25201 1026799 1258.1
## + PoblaData 1 1248 1000351 1258.5
## + Medicos 1 640 1000958 1258.6
## + ImmunSaramp 1 625 1000974 1258.6
## + Tuberculosis 1 172 1001427 1258.7
## + Urbano 1 166 1001432 1258.7
## + Lesion 1 41 1001558 1258.7
## + PoblaMid 1 0 1001598 1258.7
## - PBI 1 32560 1034159 1259.1
## - Camas 1 33756 1035355 1259.3
## - Pobla80 1 106140 1107738 1268.7
## - BCG 1 311961 1313560 1292.4
##
## Step: AIC=1254.9
## muertes.permil ~ Pobla80 + PoblaDens + Mujeres + Diabetes + HipTen.M +
## BCG + Camas + PBI + TempMarzo
##
## Df Sum of Sq RSS AIC
## - TempMarzo 1 2517 1005643 1253.2
## - Mujeres 1 3537 1006663 1253.4
## - HipTen.M 1 6797 1009923 1253.8
## <none> 1003126 1254.9
## - PoblaDens 1 18597 1021723 1255.5
## + DisMort 1 1527 1001599 1256.7
## + PoblaData 1 1349 1001777 1256.7
## - Diabetes 1 28230 1031356 1256.8
## + ImmunSaramp 1 980 1002146 1256.8
## + Medicos 1 821 1002305 1256.8
## + Tuberculosis 1 39 1003087 1256.9
## + Lesion 1 13 1003113 1256.9
## + Urbano 1 1 1003125 1256.9
## + PoblaMid 1 0 1003126 1256.9
## - Camas 1 37354 1040480 1258.0
## - PBI 1 47374 1050500 1259.3
## - Pobla80 1 139613 1142739 1271.0
## - BCG 1 316035 1319161 1291.0
##
## Step: AIC=1253.25
## muertes.permil ~ Pobla80 + PoblaDens + Mujeres + Diabetes + HipTen.M +
## BCG + Camas + PBI
##
## Df Sum of Sq RSS AIC
## - Mujeres 1 3106 1008749 1251.7
## - HipTen.M 1 6220 1011863 1252.1
## <none> 1005643 1253.2
## - PoblaDens 1 16481 1022124 1253.5
## + TempMarzo 1 2517 1003126 1254.9
## + DisMort 1 2347 1003296 1254.9
## + Medicos 1 1967 1003677 1255.0
## - Diabetes 1 28136 1033780 1255.1
## + PoblaData 1 923 1004720 1255.1
## + ImmunSaramp 1 741 1004903 1255.1
## + Tuberculosis 1 105 1005538 1255.2
## + PoblaMid 1 74 1005570 1255.2
## + Lesion 1 15 1005628 1255.2
## + Urbano 1 14 1005630 1255.2
## - PBI 1 45714 1051357 1257.4
## - Camas 1 61792 1067435 1259.5
## - Pobla80 1 137573 1143216 1269.1
## - BCG 1 323740 1329383 1290.0
##
## Step: AIC=1251.67
## muertes.permil ~ Pobla80 + PoblaDens + Diabetes + HipTen.M +
## BCG + Camas + PBI
##
## Df Sum of Sq RSS AIC
## - HipTen.M 1 5691 1014440 1250.5
## - PoblaDens 1 14251 1023000 1251.6
## <none> 1008749 1251.7
## + Mujeres 1 3106 1005643 1253.2
## + DisMort 1 2921 1005828 1253.3
## + TempMarzo 1 2086 1006663 1253.4
## + Medicos 1 1901 1006848 1253.4
## + ImmunSaramp 1 884 1007865 1253.5
## + PoblaData 1 720 1008029 1253.6
## + PoblaMid 1 495 1008254 1253.6
## + Tuberculosis 1 172 1008577 1253.7
## + Lesion 1 157 1008592 1253.7
## + Urbano 1 1 1008748 1253.7
## - Diabetes 1 34542 1043291 1254.3
## - Camas 1 59821 1068570 1257.7
## - PBI 1 61058 1069807 1257.8
## - Pobla80 1 201816 1210565 1275.0
## - BCG 1 329319 1338068 1288.9
##
## Step: AIC=1250.46
## muertes.permil ~ Pobla80 + PoblaDens + Diabetes + BCG + Camas +
## PBI
##
## Df Sum of Sq RSS AIC
## - PoblaDens 1 12288 1026728 1250.1
## <none> 1014440 1250.5
## + HipTen.M 1 5691 1008749 1251.7
## + DisMort 1 4271 1010169 1251.9
## + Mujeres 1 2577 1011863 1252.1
## + Medicos 1 2448 1011992 1252.1
## + TempMarzo 1 1618 1012822 1252.2
## + ImmunSaramp 1 1161 1013279 1252.3
## + PoblaData 1 863 1013577 1252.3
## + PoblaMid 1 335 1014105 1252.4
## + Lesion 1 37 1014403 1252.5
## + Tuberculosis 1 27 1014413 1252.5
## + Urbano 1 1 1014439 1252.5
## - Diabetes 1 31008 1045448 1252.6
## - PBI 1 62358 1076798 1256.8
## - Camas 1 69617 1084057 1257.7
## - Pobla80 1 196620 1211060 1273.1
## - BCG 1 340051 1354491 1288.6
##
## Step: AIC=1250.13
## muertes.permil ~ Pobla80 + Diabetes + BCG + Camas + PBI
##
## Df Sum of Sq RSS AIC
## <none> 1026728 1250.1
## + PoblaDens 1 12288 1014440 1250.5
## + DisMort 1 3874 1022854 1251.6
## + HipTen.M 1 3728 1023000 1251.6
## - Diabetes 1 28119 1054847 1251.9
## + Medicos 1 1169 1025558 1252.0
## + PoblaMid 1 967 1025760 1252.0
## + Lesion 1 899 1025829 1252.0
## + ImmunSaramp 1 868 1025860 1252.0
## + Mujeres 1 745 1025983 1252.0
## + PoblaData 1 585 1026142 1252.0
## + TempMarzo 1 272 1026456 1252.1
## + Tuberculosis 1 37 1026691 1252.1
## + Urbano 1 13 1026715 1252.1
## - PBI 1 51489 1078216 1254.9
## - Camas 1 67763 1094490 1257.0
## - Pobla80 1 205816 1232544 1273.5
## - BCG 1 342848 1369576 1288.2
##
## Call:
## lm(formula = muertes.permil ~ Pobla80 + Diabetes + BCG + Camas +
## PBI, data = df_covid_muertes.permil)
##
## Coefficients:
## (Intercept) Pobla80 Diabetes BCG Camas PBI
## 267.056 30.484 -3.972 -243.886 -13.117 1.057
El mejor modelo resultante del proceso de selección ha sido:
muertes.permil_modelo <- (lm(formula = muertes.permil ~ Pobla80 + Diabetes + BCG + Camas + PBI, data = df_covid_muertes.permil))
summary(muertes.permil_modelo)
##
## Call:
## lm(formula = muertes.permil ~ Pobla80 + Diabetes + BCG + Camas +
## PBI, data = df_covid_muertes.permil)
##
## Residuals:
## Min 1Q Median 3Q Max
## -233.64 -27.33 -7.42 14.81 435.50
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 267.0564 41.4189 6.448 1.93e-09 ***
## Pobla80 30.4844 5.9039 5.163 8.64e-07 ***
## Diabetes -3.9723 2.0813 -1.909 0.05848 .
## BCG -243.8862 36.5964 -6.664 6.45e-10 ***
## Camas -13.1168 4.4273 -2.963 0.00361 **
## PBI 1.0571 0.4093 2.583 0.01089 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 87.86 on 133 degrees of freedom
## Multiple R-squared: 0.5322, Adjusted R-squared: 0.5146
## F-statistic: 30.26 on 5 and 133 DF, p-value: < 2.2e-16
Es recomendable mostrar el intervalo de confianza para cada uno de los coeficientes parciales de regresión:
confint(lm(formula = muertes.permil ~ Pobla80 + Diabetes + BCG + Camas +
PBI, data = df_covid_muertes.permil))
## 2.5 % 97.5 %
## (Intercept) 185.131408 348.981304
## Pobla80 18.806712 42.162176
## Diabetes -8.089130 0.144497
## BCG -316.272511 -171.499961
## Camas -21.873783 -4.359874
## PBI 0.247487 1.866761
Conclusion de obtener los mejores modelos para ambas variables, es mejor utilizar aquel que considera como variable de respuesta las muertes en forma logaritima porque presenta un \(R^2\) superior, un menor \(p-value\) y \(RSE\), por ende sus intervalos de confianza son más cortos también
Considerando como criterios de evaluación las salidas obtenidas de los modelos y su análisis de residuos, el modelo final es mejor porque cumple con los principios “obligatorios” para realizar una regresión lineal y mejores valores en cuanto a salidas. A su vez el modelo final es más sencillo ya que esta compuesto por un menor número de variables y su interpretación es más facil.
Dado que ambos modelos son regresiones podríamos utilizar como métrica el como métrica el Mean Square Error (MSE), pero para esto deberíamos dividir nuestra muestra en test y train y volver a generar los modelos.
Dividimos el dataset en train y test
split <- sample.split(df_covid_total$l10muertes.permil, SplitRatio = 2/3)
training_set <- subset(df_covid_total, split==T)
test_set <- subset(df_covid_total, split==F)
training_set
## Pobla80 PoblaMid PoblaData PoblaDens Mujeres Urbano DisMort Lesion
## 1 0.2771541 54.32490 0.37172386 0.56937760 48.63585 25.495 29.8 19.5
## 2 2.7410163 68.58239 0.02866376 1.04612263 49.06309 60.319 17.0 4.0
## 3 1.2709846 63.48882 0.42228429 0.17730075 49.48427 72.629 14.2 9.5
## 4 0.2723907 50.97470 0.30809762 0.24713052 50.53046 65.514 16.5 9.2
## 5 2.6111754 64.12128 0.44494502 0.16258510 51.23735 91.870 15.8 6.5
## 7 4.0436339 65.15291 0.24992369 0.03249129 50.19962 86.012 9.1 5.9
## 8 5.2369767 66.70049 0.08847037 1.07206927 50.82943 58.297 11.4 5.2
## 10 0.9964088 67.13559 1.61356039 12.39579312 49.38730 36.632 21.6 7.5
## 11 3.8045048 68.28891 0.09485386 0.46728800 53.45605 78.595 23.7 7.0
## 12 5.6948380 64.15583 0.11422068 3.77214927 50.59332 98.001 11.4 6.4
## 13 1.0395255 64.98378 0.00383071 0.16793994 50.19252 45.724 22.1 13.2
## 15 1.2095158 68.22563 0.00754394 0.19777528 47.00264 40.895 23.3 10.5
## 16 1.6248620 61.73450 0.11353142 0.10480146 49.78340 69.425 17.2 13.1
## 17 3.3861895 68.76346 0.03323929 0.64920488 51.01054 48.245 17.8 3.7
## 18 0.4939442 61.66318 0.02254126 0.03977425 51.73076 69.446 20.3 8.3
## 20 0.7583938 72.10039 0.00428962 0.81396964 48.03618 77.629 16.6 7.4
## 22 0.2453268 52.64494 0.19751535 0.72191283 50.09548 29.358 21.7 11.0
## 26 4.3071336 66.89774 0.37058856 0.04075308 50.39153 81.411 9.8 6.1
## 27 0.3528256 52.87991 0.04666377 0.07490412 50.43647 41.364 23.1 10.3
## 28 1.7597254 68.44406 0.49648685 0.44748702 50.92577 80.778 15.8 15.0
## 29 0.3889863 57.45457 0.00832322 4.47244478 49.55870 28.965 22.9 10.9
## 30 0.2877278 55.55478 0.05244363 0.15356846 50.06560 66.916 16.7 9.9
## 31 5.5638202 65.04263 0.04089400 0.73077198 51.85262 56.947 16.7 5.3
## 34 0.6099089 65.89830 0.00958920 0.41368421 47.36679 77.777 19.6 10.4
## 35 1.5873319 64.94005 0.10627165 2.19978576 50.00780 81.074 19.0 12.0
## 37 0.7910340 60.97150 0.98423595 0.98873469 49.46997 42.704 27.7 5.8
## 38 1.8419292 64.58083 0.06420744 3.09881467 53.11400 72.023 14.0 15.4
## 39 0.2886712 60.42552 0.01308974 0.46665740 44.45585 72.143 22.0 10.7
## 40 5.5491132 64.01657 0.01320884 0.30386105 52.85843 68.880 17.0 4.5
## 42 0.5795601 65.03770 0.00883483 0.48357033 49.30050 56.248 30.6 5.4
## 43 5.4057724 62.13403 0.05518050 0.18156856 50.72076 85.382 10.2 5.5
## 47 3.6827447 65.33927 0.03731000 0.65275202 52.29124 58.632 24.9 3.6
## 48 6.6270801 64.91701 0.82927922 2.37370970 50.66037 77.312 12.1 4.0
## 50 7.2679122 64.27348 0.10727668 0.83224732 50.91620 79.058 12.4 2.9
## 51 1.0548473 60.75253 0.17247807 1.60953779 50.75935 51.054 14.9 15.7
## 52 0.3195615 53.22380 0.12414318 0.50522212 51.82111 36.140 22.4 9.2
## 53 1.2722362 65.33518 0.00779004 0.03957348 49.80802 26.606 30.5 12.4
## 55 1.0293956 63.56850 0.09587522 0.85687032 50.04934 57.096 14.0 19.6
## 56 4.2713096 66.43028 0.09768785 1.07906606 52.43243 71.351 23.0 4.4
## 58 2.7008155 68.71630 0.18729160 0.25189446 50.72703 87.564 12.4 7.1
## 59 1.7877871 71.20211 13.92730000 1.48348833 48.67937 59.152 17.0 7.0
## 60 0.9448065 66.76674 13.52617328 4.54938073 48.02354 34.030 23.3 11.3
## 61 0.8561815 67.59164 2.67663435 1.47752190 49.64388 55.325 26.4 6.0
## 62 1.1233084 69.33887 0.81800269 0.50222420 49.43913 74.898 14.8 10.1
## 63 0.4831038 58.28983 0.38433600 0.88530570 49.40868 70.473 21.3 28.4
## 64 3.0188525 64.72778 0.04853506 0.70452983 50.42551 63.170 10.3 4.3
## 66 7.1734357 63.91920 0.60431283 2.05450748 51.37667 70.438 9.5 3.8
## 67 2.0456797 67.45326 0.02934855 2.70993075 50.33983 55.674 14.7 8.7
## 69 0.6023762 61.90802 0.09956011 1.12142498 49.38968 90.979 19.2 10.9
## 70 1.4932044 64.14760 0.18276499 0.06769826 51.51148 57.428 26.8 9.5
## 71 0.2699139 57.87865 0.51393010 0.90299417 50.31602 27.030 13.4 9.6
## 72 0.2327419 75.91064 0.04137309 2.32172222 39.54817 100.000 17.4 12.8
## 74 1.4828557 66.90176 0.06848925 6.69494135 49.70581 88.593 17.9 5.8
## 80 0.4241700 56.34513 0.26262368 0.45139856 50.12397 37.191 22.9 10.6
## 82 1.0741699 69.33310 0.31528585 0.95962821 48.57852 76.036 17.2 8.9
## 85 2.0227961 70.73213 0.01265303 6.23301970 50.57711 40.793 22.6 4.8
## 88 0.6283914 65.50689 0.03170208 0.02040609 50.66954 68.445 30.2 10.6
## 92 0.7791075 67.84431 0.53708395 0.82238615 51.80790 30.579 24.2 8.6
## 93 0.6151794 59.45372 0.02448255 0.02973746 51.55369 50.032 21.3 9.8
## 94 0.7516195 63.85806 0.28087871 1.95939107 54.53534 19.740 21.8 8.8
## 95 4.6976392 64.69565 0.17231017 5.11457910 50.22094 91.490 11.2 5.2
## 96 3.7311137 64.69414 0.04885500 0.18554176 50.83777 86.538 10.1 6.0
## 97 1.1025688 64.55082 0.06465513 0.53727048 50.71271 58.522 14.2 12.7
## 100 0.4596337 75.36071 0.04829483 0.15604145 34.01408 84.539 17.8 17.7
## 101 0.6545620 60.41741 2.12215030 2.75289319 48.53807 36.666 24.7 7.3
## 103 1.2135437 64.12928 0.06956071 0.17508359 49.15161 61.585 17.5 12.0
## 104 1.6809015 66.12100 0.31989256 0.24991606 50.33776 77.907 12.6 10.5
## 105 0.7893793 63.91439 1.06651922 3.57688305 49.74166 46.907 26.8 7.5
## 108 0.1847213 85.08917 0.02781677 2.39593196 24.49529 99.135 15.3 25.9
## 109 4.7084438 66.12674 0.19473936 0.84639847 51.34374 53.998 21.4 3.6
## 110 0.3624706 57.08623 0.12301939 4.98659870 50.86106 17.211 18.2 13.5
## 111 2.4482249 67.86891 0.00110210 2.82589744 49.20878 52.198 23.2 5.6
## 114 4.0191136 65.96453 0.06982084 0.79831740 51.00252 56.092 19.1 3.0
## 115 0.3522140 55.97380 0.07650154 1.05987171 50.12127 42.055 30.5 8.9
## 116 2.1766595 76.25834 0.05638676 79.52998418 47.65813 100.000 9.3 3.7
## 117 3.2223629 68.92462 0.05447011 1.13290578 51.33833 53.726 17.2 6.0
## 118 5.3152643 65.37135 0.02067372 1.02639860 50.24521 54.541 12.7 6.6
## 119 0.7184723 65.60251 0.57779622 0.47630120 50.69415 66.355 26.2 9.1
## 120 3.2120425 72.60812 0.51635256 5.29652104 49.91688 81.459 7.8 10.0
## 121 6.1672057 65.95449 0.46723749 0.93529058 50.89664 80.321 9.9 3.5
## 122 1.6065781 65.32978 0.21670000 3.45558922 51.96682 18.476 17.4 9.7
## 124 5.1493834 66.46583 0.08516543 2.15521378 50.42712 73.797 8.6 6.1
## 125 0.5234433 60.19383 0.09100837 0.65572714 49.58384 27.134 25.3 7.6
## 126 2.5315654 71.01212 0.69428524 1.35897207 51.26870 49.949 14.5 10.2
## 128 1.7197442 67.51420 0.11565204 0.74441323 50.43715 68.945 16.1 6.4
## 130 0.2057545 51.12849 0.42723139 2.13061734 50.77608 23.774 21.9 12.7
## 131 3.9876216 67.75290 0.44622516 0.77029667 53.68775 69.352 24.7 5.0
## 132 0.1307769 84.31149 0.09630959 1.35609110 30.63669 86.522 16.8 16.8
## 134 3.8751036 65.48331 3.27167434 0.35766089 50.52001 82.256 14.6 6.6
## 135 4.3947641 64.57750 0.03449299 0.19708028 51.72154 95.334 16.7 7.5
## 136 0.8369038 66.89480 0.32955400 0.77469205 50.13736 50.478 24.5 6.0
## 139 0.4222739 54.65941 0.14439018 0.37324591 52.35675 32.209 19.3 12.3
## Tuberculosis Diabetes ImmunSaramp HipTen.M BCG Medicos Camas
## 1 189.0 9.2 64 19.8 1 0.24009091 0.4363636
## 2 18.0 9.0 94 39.4 1 1.21237143 2.9375000
## 3 69.0 6.7 80 23.0 1 1.31202500 1.9000000
## 4 355.0 4.5 50 25.2 1 0.17300000 0.8000000
## 5 27.0 5.9 94 32.9 1 3.57165000 4.6000000
## 7 6.6 5.6 95 32.8 1 3.27402222 3.8783333
## 8 7.1 6.6 94 38.8 1 4.66801111 7.7000000
## 10 221.0 9.2 97 17.4 1 0.39047692 0.5750000
## 11 31.0 5.0 97 45.5 1 4.22154000 11.2000000
## 12 9.0 4.6 96 35.0 0 2.79814444 6.5500000
## 13 30.0 17.1 97 25.1 1 0.96785000 1.1600000
## 15 149.0 10.3 97 20.4 1 0.26431111 1.7333333
## 16 108.0 6.8 89 27.2 1 0.71612500 1.1000000
## 17 25.0 9.0 68 43.2 1 1.77503333 3.3666667
## 18 275.0 5.8 97 41.0 1 0.35774444 2.0000000
## 20 68.0 13.3 99 32.0 1 1.38302727 2.7542857
## 22 48.0 7.3 88 12.4 1 0.04237143 0.6500000
## 26 5.6 7.6 90 23.9 0 2.32944444 3.0714286
## 27 540.0 6.0 49 33.2 1 0.04973333 1.1000000
## 28 33.0 7.4 95 28.7 1 1.70129231 1.3166667
## 29 35.0 12.3 90 41.5 1 0.18323333 2.2000000
## 30 375.0 6.0 75 19.3 1 0.12880000 1.6000000
## 31 8.4 5.4 93 38.5 1 2.80697000 5.6354545
## 34 260.0 5.1 86 22.3 1 0.21512500 1.4571429
## 35 45.0 8.6 95 29.3 1 1.37733333 1.4375000
## 37 12.0 17.2 94 23.9 1 1.73048750 1.5100000
## 38 70.0 8.8 81 30.0 1 1.65428000 0.9900000
## 39 201.0 6.0 30 25.2 1 0.40000000 2.0666667
## 40 13.0 4.2 87 42.9 1 3.34070000 5.3600000
## 42 54.0 14.7 94 25.0 1 0.58042000 2.1475000
## 43 4.7 5.6 96 46.6 1 3.14394000 5.9600000
## 47 80.0 5.8 98 41.0 1 4.62520000 3.1222222
## 48 7.3 10.4 97 34.2 1 3.84022000 8.2555556
## 50 4.5 4.7 97 36.4 1 5.71011111 4.6555556
## 51 26.0 10.0 87 26.5 1 0.62945000 0.6250000
## 52 176.0 2.4 48 41.0 1 0.09196667 0.3000000
## 53 83.0 11.6 98 26.3 1 0.56823333 2.1600000
## 55 37.0 7.3 89 25.7 1 0.57160000 0.7285714
## 56 6.4 6.9 99 47.4 1 3.24861667 7.3000000
## 58 18.0 8.6 93 28.2 1 1.03645000 2.1714286
## 59 61.0 9.2 99 32.3 1 1.57320000 3.4066667
## 60 199.0 10.4 90 29.2 1 0.67390833 0.8000000
## 61 316.0 6.3 75 24.7 1 0.24655000 0.9000000
## 62 14.0 9.6 99 25.9 1 0.98516000 1.4400000
## 63 42.0 8.8 83 23.9 1 0.72533333 1.3100000
## 64 7.0 3.2 92 32.2 1 2.81283000 3.9555556
## 66 7.0 5.0 93 36.5 0 3.94927778 3.6875000
## 67 2.9 11.3 89 33.6 1 0.54227143 1.7571429
## 69 5.0 12.7 92 26.3 1 2.24923636 1.7818182
## 70 68.0 6.1 99 33.1 1 3.60587000 7.4111111
## 71 292.0 3.1 89 36.8 1 0.18122857 1.4000000
## 72 23.0 12.2 99 26.5 1 2.16873636 1.9800000
## 74 11.0 11.2 82 29.6 0 2.55344444 3.3800000
## 80 233.0 4.5 62 32.2 1 0.17360000 0.2500000
## 82 92.0 16.7 96 25.2 1 1.24358000 1.8312500
## 85 13.0 22.0 99 48.4 1 1.45775556 3.2333333
## 88 428.0 4.7 99 30.6 1 2.96358889 6.3266667
## 92 338.0 3.9 93 25.5 1 0.53712000 0.7500000
## 93 524.0 4.5 82 41.9 1 0.37305000 3.0000000
## 94 151.0 7.2 91 22.1 1 0.57297500 2.6500000
## 95 5.3 5.4 93 33.8 0 3.40828889 4.6000000
## 96 7.3 6.2 92 30.9 1 2.70726000 2.5500000
## 97 41.0 11.4 99 26.2 1 0.74390000 0.9222222
## 100 5.9 10.1 99 26.2 1 1.95183077 1.8600000
## 101 265.0 19.9 76 21.1 1 0.84727500 0.7200000
## 103 43.0 9.6 93 27.2 1 0.96393333 1.2857143
## 104 123.0 6.6 85 17.8 1 1.18280000 1.4875000
## 105 554.0 7.1 67 23.5 1 1.25186667 0.5833333
## 108 31.0 15.6 99 36.2 1 2.47302500 1.6400000
## 109 68.0 6.9 90 46.7 1 2.40146667 6.4555556
## 110 59.0 5.1 99 30.4 1 0.09168889 1.6000000
## 111 6.3 11.6 99 30.7 1 0.65870000 3.3000000
## 114 17.0 9.0 92 41.6 1 2.42901111 5.6125000
## 115 298.0 2.4 80 39.7 1 0.02050000 0.4000000
## 116 47.0 5.5 95 22.1 1 1.76859091 2.7457143
## 117 5.8 6.5 96 33.7 1 3.11790000 6.3400000
## 118 5.3 5.9 93 37.2 1 2.59476000 4.6555556
## 119 520.0 12.7 70 45.9 1 0.76988750 2.8000000
## 120 66.0 6.9 98 23.5 1 2.05984615 10.6080000
## 121 9.4 6.9 97 37.1 1 4.15920000 3.1888889
## 122 64.0 10.7 99 25.8 1 0.77147000 3.5500000
## 124 6.4 5.7 96 31.7 1 4.00455000 5.1222222
## 125 84.0 6.1 98 25.4 1 1.78443333 5.2666667
## 126 153.0 7.0 96 23.8 1 0.40473333 2.1000000
## 128 35.0 8.5 96 25.2 1 1.16097143 2.0545455
## 130 200.0 2.5 86 32.7 1 0.10457500 0.7500000
## 131 80.0 6.1 91 50.6 1 3.35196667 8.9222222
## 132 1.0 16.3 99 19.2 1 1.70489167 1.6777778
## 134 3.0 10.8 92 31.8 0 2.52747500 3.0333333
## 135 33.0 7.3 97 38.8 1 4.16766000 2.5250000
## 136 70.0 6.5 96 27.7 1 2.50781250 4.5888889
## 139 210.0 1.8 88 32.0 1 0.06561250 2.3500000
## PBI TempMarzo l10muertes.permil
## 1 1.8351696 7.60 0.85166698
## 2 11.3351950 6.04 1.09735434
## 3 14.1967389 17.91 1.19736588
## 4 6.7205961 22.78 0.05301271
## 5 20.0684923 17.51 1.08768715
## 7 45.7525548 25.37 0.70937665
## 8 48.9687140 1.42 1.86867832
## 10 3.3061083 25.42 0.64062316
## 11 18.1721809 -0.69 1.37219412
## 12 45.2631622 5.23 2.91424609
## 13 8.0937796 24.45 0.79385771
## 15 8.3417246 5.68 0.00000000
## 16 6.5317860 22.07 1.40930364
## 17 11.6971771 4.01 1.66678153
## 18 16.1336867 24.30 0.15945618
## 20 80.8004129 25.92 0.75300190
## 22 1.6709928 30.63 0.56624131
## 26 44.2264907 -18.72 2.26374838
## 27 0.8532664 26.96 0.08432564
## 28 13.2116325 25.14 1.23486238
## 29 2.6420144 25.20 0.53185125
## 30 5.6636489 25.60 0.66491803
## 31 22.9922117 5.83 1.40989932
## 34 2.7442687 25.75 1.29603122
## 35 13.9050879 22.88 1.65899033
## 37 10.8110341 17.83 0.96804820
## 38 7.2348467 25.70 0.84966889
## 39 30.5908474 25.04 1.00721356
## 40 28.8340001 -2.35 1.70728513
## 42 8.8754441 25.00 0.00000000
## 43 42.8552430 -6.09 1.76134842
## 47 9.5834608 0.72 0.62493108
## 48 46.5762068 3.87 2.01040779
## 50 27.2065489 8.19 1.23366924
## 51 7.5159291 22.94 0.69394933
## 52 2.0022876 27.63 0.43000974
## 53 7.1987245 25.65 1.17956888
## 55 4.4336960 23.38 1.32704478
## 56 25.7573736 5.44 1.72513328
## 58 22.2523960 10.87 1.66184336
## 59 13.5313781 0.49 0.63650295
## 60 5.8366566 23.45 0.63846947
## 61 10.5772045 25.79 0.81312576
## 62 18.4501839 11.33 1.97066822
## 63 15.8895142 15.12 0.74455172
## 64 59.3055780 6.00 2.52768884
## 66 37.7630816 6.52 2.73899149
## 67 8.5085469 23.44 0.60923050
## 69 9.2014965 13.08 0.27966158
## 70 24.1030338 -3.96 0.48064752
## 71 2.8839337 26.10 0.31600904
## 72 75.8307296 19.23 1.63646809
## 74 13.2450688 10.39 0.68089875
## 80 1.7044431 23.99 0.03187466
## 82 25.8714034 25.19 0.66721788
## 85 19.3987280 25.48 0.94954834
## 88 11.1277975 -8.80 0.00000000
## 92 5.0214146 22.74 0.04599322
## 93 10.2230967 22.67 0.00000000
## 94 2.4752041 10.02 0.05782208
## 95 49.9843155 4.95 2.53367393
## 96 36.4995043 13.60 0.74060910
## 97 4.8837325 24.95 0.80708405
## 100 42.4790524 23.40 0.94784219
## 101 4.6501098 16.01 0.84119511
## 103 11.4029323 25.84 0.41184731
## 104 12.3515166 19.99 2.09868025
## 105 7.0082665 25.13 0.97663292
## 108 123.2139364 21.78 1.07132447
## 109 21.6182719 3.40 1.80343313
## 110 1.7889788 19.25 0.00000000
## 111 10.9317631 25.90 0.00000000
## 114 14.9080484 4.91 1.54868038
## 115 1.4959394 27.65 0.83772947
## 116 86.0684237 28.62 0.70577580
## 117 29.0915206 2.40 0.78819906
## 118 31.7402860 3.38 1.72227622
## 119 12.8666891 21.10 1.02339821
## 120 34.6370853 3.66 0.79306494
## 121 34.5888453 8.60 2.76446761
## 122 11.1185327 27.03 0.16478915
## 124 61.3146089 0.09 2.28867018
## 125 2.7293337 -3.08 0.78207686
## 126 15.8571484 27.38 0.26030714
## 128 11.2660561 14.21 0.71183934
## 130 1.8103287 23.68 0.00000000
## 131 8.4417522 1.18 1.18842716
## 132 65.5180899 22.61 1.43897112
## 134 55.0581658 0.06 2.48855760
## 135 20.4797528 21.26 0.86794498
## 136 6.8361061 5.38 0.15375896
## 139 2.5606953 22.92 0.10620013
Volvemos a generar nuestros modelos pero usando el
training_set
#Modelo PBI
modelo_pbi2 <- lm(l10muertes.permil ~ PoblaDens+Pobla80*PBI+Urbano*PBI+Tuberculosis*PBI+PBI*Camas+TempMarzo+PBI, data = training_set )
summary(modelo_pbi2)
##
## Call:
## lm(formula = l10muertes.permil ~ PoblaDens + Pobla80 * PBI +
## Urbano * PBI + Tuberculosis * PBI + PBI * Camas + TempMarzo +
## PBI, data = training_set)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.00715 -0.32674 -0.05597 0.35975 1.09462
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.603e-01 3.352e-01 1.373 0.1735
## PoblaDens -9.517e-03 7.495e-03 -1.270 0.2079
## Pobla80 1.072e-01 8.686e-02 1.234 0.2206
## PBI 1.644e-02 1.904e-02 0.863 0.3906
## Urbano 8.902e-03 3.769e-03 2.362 0.0206 *
## Tuberculosis -6.855e-06 7.100e-04 -0.010 0.9923
## Camas -8.978e-02 6.541e-02 -1.372 0.1737
## TempMarzo -1.214e-02 7.288e-03 -1.666 0.0996 .
## Pobla80:PBI 2.317e-03 2.635e-03 0.879 0.3819
## PBI:Urbano -1.344e-04 1.858e-04 -0.723 0.4717
## PBI:Tuberculosis -5.225e-05 6.448e-05 -0.810 0.4201
## PBI:Camas 3.849e-04 2.384e-03 0.161 0.8721
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.48 on 80 degrees of freedom
## Multiple R-squared: 0.6237, Adjusted R-squared: 0.572
## F-statistic: 12.05 on 11 and 80 DF, p-value: 5.591e-13
# Predicciones de entrenamiento
predicciones_train <- predict(modelo_pbi2, newdata = training_set)
# MSE de entrenamiento
training_mse <- mean((predicciones_train - training_set$l10muertes.permil)^2)
paste("Error (mse) de entrenamiento:", training_mse)
## [1] "Error (mse) de entrenamiento: 0.200319271965709"
# Predicciones de test
predicciones_test <- predict(modelo_pbi2, newdata = test_set)
# MSE de test
test_mse_ols <- mean((predicciones_test - test_set$l10muertes.permil)^2)
paste("Error (mse) de test:", test_mse_ols)
## [1] "Error (mse) de test: 0.252551087377933"
#Modelo final
l10muertes_modelo_2 <- (lm(formula = l10muertes.permil ~ Pobla80 + PoblaDens + Urbano + Tuberculosis + ImmunSaramp + BCG + Camas + PBI +TempMarzo, data = training_set))
summary(l10muertes_modelo_2)
##
## Call:
## lm(formula = l10muertes.permil ~ Pobla80 + PoblaDens + Urbano +
## Tuberculosis + ImmunSaramp + BCG + Camas + PBI + TempMarzo,
## data = training_set)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.89907 -0.30115 -0.01224 0.29783 1.10788
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.5278406 0.5323421 2.870 0.00522 **
## Pobla80 0.1961412 0.0395877 4.955 3.83e-06 ***
## PoblaDens -0.0104219 0.0064053 -1.627 0.10756
## Urbano 0.0048566 0.0031053 1.564 0.12168
## Tuberculosis -0.0006070 0.0004863 -1.248 0.21550
## ImmunSaramp -0.0061950 0.0047734 -1.298 0.19799
## BCG -0.4489113 0.2291737 -1.959 0.05353 .
## Camas -0.0654528 0.0340884 -1.920 0.05832 .
## PBI 0.0077048 0.0031269 2.464 0.01583 *
## TempMarzo -0.0095123 0.0069944 -1.360 0.17756
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4713 on 82 degrees of freedom
## Multiple R-squared: 0.6281, Adjusted R-squared: 0.5873
## F-statistic: 15.39 on 9 and 82 DF, p-value: 2.295e-14
# Predicciones de entrenamiento
predicciones_train <- predict(l10muertes_modelo_2, newdata = training_set)
# MSE de entrenamiento
training_mse <- mean((predicciones_train - training_set$l10muertes.permil)^2)
paste("Error (mse) de entrenamiento:", training_mse)
## [1] "Error (mse) de entrenamiento: 0.197962139913156"
# Predicciones de test
predicciones_test <- predict(l10muertes_modelo_2, newdata = test_set)
# MSE de test
test_mse_step <- mean((predicciones_test - test_set$l10muertes.permil)^2)
paste("Error (mse) de test:", test_mse_step)
## [1] "Error (mse) de test: 0.237134745321555"
Comparación
df_comparacion <- data.frame(
modelo = c("ols", "Stepwise"),
mse = c(test_mse_ols,test_mse_step)
)
ggplot(data = df_comparacion, aes(x = modelo, y = mse)) +
geom_col(width = 0.5) +
geom_text(aes(label = round(mse, 2)), vjust = -0.1) +
theme_bw() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
Practicamente los modelos son iguales la diferencia en el MSE es pequeña, es menor el del stepwise y teniendo encuenta el estudio de residuos es preferible el modelo final obtenido.
Modelo final
\[\hat{l10muertes.pormil} = 1.58+0.18\hat{Pobla80}-0.0004\hat{Tuber}\] \[-0.007\hat{Urbano}-0.005\hat{ImmunSaramp}\] \[-0.08\hat{Camas}-0.01\hat{TempMarzo}+0.007\hat{PBI}\] \[+0.02\hat{ExpectVida}-0.012\hat{PoblaDens}-0.54\hat{BCG}\]
Teniendo encuenta el modelo, contexto de cuando se recolectaron los datos y objetivo principal de ppder realentecer la curva.
Las recomendaciones que se pueden realizar es que:
La población mayor a 80 años es aquella más vulnerable, por lo que se recomiendan, extremas medidas de cuidado uso de tapaboca y limpieza de manos, reducir las salidas (intentar hacerlo cuando el flujo de personas sea menor y la temperatura en caso de estar en invierno sea alta y en verano moderada).
Incorporar camas y médicos al sistema de salud, por lo que se podría decidir que los residentes o medicos recien recibidos que no han iniciado su recidencia colaboren en otras áreas capacitandolos. Seleccionar médicos que esten entre los 27 y 50 años que capacitandolos puedan colaborar.
Debido al posible agotamiento que puede generar en los especialistas incluiria acompañamiento psicologico e intentaría ver la manera de que cuando el sistema no este en su pico, tengan más descanso. Dado que hay estudios que demuestran que la salud es una convinatorio de los físico y mental
En aquellos países cuya temperatura no sea muy fría recomendaria que hay más libertad de circulación principalmente para no desarrollar otras patologías provocadas por el encierro y poca sociabilización.
En caso de contar con una vacuna, se deberán vacunar primero a los médicos que esten expuestos y población de 80 años.
Aquellos países con PBI bajo que no puedan contar con capital para la compra de materiales o generar más médicos deberán optar por medidas más estrictas y buscar apoyo económico, porque su economía puede verse resentida.